Slashdot Mirror


Platform Independent C++ OS Library?

quench writes "Hello! I have been away from Windows and Linux application software for 5 years or so, doing mainly C-like embedded C++ programming. Now, I am about to start a project emulating embedded hardware on Windows. Been there, doing #ifdef WIN32 and #ifdef LINUX stuff, don't really want to go there any more. What I actually need is a platform independent lib covering Windows and Linux variants to handle sockets, IPC and threads abstractions. And a rock solid but simple embedded database to emulate flash memory. My reflex said, go for ACE and Berkeley-DB. Tell me, am I out of time? Am I missing something new and trendy, easier to use and better? Did time stand still?"

310 comments

  1. JAVA by Anonymous Coward · · Score: 3, Insightful

    This platform independent lib you are looking for is called JAVA.

    1. Re:JAVA by HiThere · · Score: 3, Interesting

      That's not really a bad suggestion. Ruby, Python, even some dialects of Basic would work.

      Also consider Pascal. There are dialects of Pascal that have strongly attempted to be identical across platform boundaries.

      Additionally, anything that's running on a virtual machine would be a reasonable consideration. That includes qemu and xen, not just Java, Python, etc.

      What's at question are "What are the requirements??". Without knowing that, there's no way to know which, if any, of these suggestions are reasonable. Given that the initial language is C++, I'd expect that Pascal is the best replacement, with Java a close second. But if speed isn't a limiting factor than the other suggestions should be given consideration.

      Of course, what he's asking it probably more readily answered by something like FLTK, but it's hard to know, since we don't know exactly which features he needs to be handled by his library. FLTK is platform independent, and callable from C++, but pretty much only handles the graphic interface. If that's all he needs, then it's a good answer, but we don't know what his needs are.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    2. Re:JAVA by Anonymous Coward · · Score: 0

      There are a lot of languages that can be compiled to the Java virtual machine, but you won't find C or C++ in the list. Even on .NET you can't use half of modern C++ if you stay within the bounds of managed code.

    3. Re:JAVA by AmberBlackCat · · Score: 1

      One thing that appears to be a requirement is this must be a library for C++.

    4. Re:JAVA by Anonymous Coward · · Score: 0

      yeah, if you're a moron.

    5. Re:JAVA by buchner.johannes · · Score: 1

      There are C->Java converters.
      But if you need interoperability and work on multiple platforms, there is nothing like Java.

      You can use JNI if you have to rely on C code, but virtually every library you could need has been programmed in Java.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    6. Re:JAVA by Jeremy+Visser · · Score: 2, Insightful

      One thing that appears to be a requirement is this must be a library for C++.

      There are C->Java converters.

      Let's play spot-the-difference!

    7. Re:JAVA by Anonymous Coward · · Score: 2, Funny

      I don't think you know what that word actually means. Let me look it up for you:

      Main Entry: moron
      Pronunciation: \mor-än\
      Function: noun
      Etymology: irregular from Greek mros foolish, stupid
      Date: 1910

      1 usually offensive : a person affected with mild mental retardation
      2 : a very stupid person
      3 : someone who uses a cross-platform language to solve a cross-platform problem

      Oh snap. They've gone changed the definition of moron - so I guess you were right!

    8. Re:JAVA by Pseudonym · · Score: 1

      Ruby, Python, even some dialects of Basic would work.

      For emulating embedded hardware on Windows? This is clearly a new definition of the word "work" that I wasn't previously aware of.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    9. Re:JAVA by Simon80 · · Score: 1

      C++ is actually cross-platform, if you only use portable libraries - which brings us to the original poster's question. It sounds to me like he might want to use Qt - since 4.5 it's been LGPLed, and it has socket and threading abstractions, though I don't know if it has IPC functionality. If ACE has a sane API, then there's no need to look for something newer, but if you want to have a GUI for your software, you'll want to use Qt anyway.

    10. Re:JAVA by Anonymous Coward · · Score: 0

      Platform independent, yes.

      Write once, compile for every different version of the JRE, hope the user has the right classpath, or make one giant collection of JAR files, and hope the user has the right interpreter version.

      Also, pray that you have nothing timing critical , like an interrupt service routine or something "low level" that java needs to do, while it does garbage collection.

      Toys like cellphones can run java, but critical applications need a little more certainty and horsepower.

    11. Re:JAVA by Skizmo · · Score: 0

      This platform independent crap you are looking for is called JAVA. FTFY. ontopic : maybe you want to take a look at QT.

    12. Re:JAVA by vurian · · Score: 1

      Yes, Qt has IPC capabilities

    13. Re:JAVA by Ke3g · · Score: 0

      You sir are correct. Java is probably the best path to go unless you're doing something like Game Development (I _DO_ understand game dev is possible in Java but I'm just looking at it from the point of view that C++ would give you more power over the end-result) or something of the sort, but for general development Java meets most needs.

    14. Re:JAVA by sg_oneill · · Score: 1

      He's doing hardware emulation. Something as harsh as 3d gameing for CPU abuse. Java is not really a good suggestion here at all.

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
    15. Re:JAVA by Anonymous Coward · · Score: 0

      indeed, and java has become much beter in recent times. Also look at scala

    16. Re:JAVA by ByOhTek · · Score: 1

      He said he wanted portable. Admittedly you have to recompile for each OS, but that's better than Java's solution (write their own goofy SSL implementation, though it's available on all platforms as OpenSSL, use the platform's Regex library, though it is not consistent in all platforms).

      > sockets
      Use the MinGW compiler (or cygwin) in windows, alternatively LibSDL has a socket library. I think there are other Berkley Socket libs for Windows.
      > IPC
      Probably would work with MinGW. Not sure what this is to be honest, though.
      > threads
      Uise the MinGW compiler (or cygwin) in windows, alternatively LibSDL has a thread library. Also, there is a pthreads implementation in Windows.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    17. Re:JAVA by bugnuts · · Score: 1

      Toys like cellphones can run java, but critical applications need a little more certainty and horsepower.

      You can always throw more cpu horsepower at it, but the parent is right about Java having issues with timing. The thing is, it's difficult to schedule garbage collection, and the OP said he was looking at embedded devices.

      If any sort of real-time system is needed, you could be hosed. Java is not deterministic, and might not do what you want it to do within the time constraints that many embedded devices have. Imagine your front bumper's accelerometer goes crazy, crush sensors determine you're in a major crash, and Java is doing garbage collection instead of deploying the airbag.

    18. Re:JAVA by HiThere · · Score: 1

      Yeah, after posting I realized I should have remembered more carefully. I remembered the portable, but ...

      Still, it *does* depend on what's being embedded into what. An elevator controller using a 386 chip could run basic or python and still meet the speed requirements. This clearly isn't being what it considered, as his prior language was C++ and he's talking about "emulating embedded hardware on Windows. " I can read that in a couple of different ways. It could be (most probable) that he's writing a program to run on MSWind and emulate the action of hardware. If that's the correct reading, then Python wouldn't be a totally inappropriate choice. Of course, that raises the question of why the library needs to be portable, but he might be looking to port the code in the future.

      So my answer wasn't totally inappropriate even with fuller consideration.

      If, on the other hand, he meant to emulate running hardware connected to, or, perhaps, running a MSWind OS ... then the only answer that occurs is Qt...and I don't know if that handles what he needs.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    19. Re:JAVA by khellendros1984 · · Score: 1

      IPC is "inter-process communication". Passing information between different processes and/or threads, for instance.

      --
      It is pitch black. You are likely to be eaten by a grue.
    20. Re:JAVA by ByOhTek · · Score: 1

      Thanks. All I could think of was "instructions per second", and I knew that wasn't what the submitter was talking about.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    21. Re:JAVA by badkarmadayaccount · · Score: 1

      There are real time JVMs, if only someonewould check the frigin' Wikipedia entry...

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    22. Re:JAVA by domKing · · Score: 1

      Actually, "this platform independent lib you are looking for is called" the Java API.

      Lately, it's increasingly being made available for languages besides the Java language. And, yes, native C++ is one of them. The core Java APIs (java::lang, java::io, java::util) can be used directly from C++ without requiring a JRE or VM for development or deployment.
      NewJ for C++: Java API for Native C++

      Positives: The library is small in size and light in resource usage. Objects are managed deterministically much like C++ smart pointers and not at the whim of the GC, which may be very important for embedded systems. Applications can be deployed as a single .EXE to a flash drive and run directly.

      Negatives: Presently, java::net API classes are a work in progress, and there's no Linux version. Presently, it's only for Win32 and Windows Mobile.
      NewJ: FAQ

    23. Re:JAVA by Anonymous Coward · · Score: 0

      Ruby

      Been there, done that, changed my life, everything else afterwards is like being nailed to the floor with foot-long rusty nails dipped in putrid yeah-you'd-like-to-do-that-but-sorry-we-didn't-think-of-that-so-you-gotta-do-nasty-stuff-to-accomplish-it-and-be-ashamed-of-it-ness...

      When you start out with Ruby you think, "Wow, this is like being in kindergarten, except no one stops my fun when it gets crazy", and then you discover that you can fiddle with things like raw sockets in this wonderful sandbox full of shiny toys, and you just start to wonder, "why is anyone ever coding in anything else, seriously"?

      Daniel Smedegaard Buus

  2. Qt by Anonymous Coward · · Score: 5, Insightful

    Nokia QT rocks...

    1. Re:Qt by Anonymous Coward · · Score: 1, Informative

      I agree. I was responsible for maintaining a cross platform application (Windows, Linux, and MacOS) and it was built on Qt. Why the OP did not simply do a google search on the subject confounds me. Cross platform UI tools have been around for as long as there have been 2 or more UI platforms.

    2. Re:Qt by KirstuNael · · Score: 5, Informative

      I concur. My Qt-powered multithreaded and networked (TCP&UDP) application is compiling and working nicely in linux, osx and win32 without any os-specifc #ifdefs.

    3. Re:Qt by Anonymous Coward · · Score: 1, Interesting

      Remember one thing about LGPL. It requires that that user can replace the LGPL binary. So Qt released under LGPL must be a separate dll, no static linking.

      Although, I cannot understand how iPhone and its apps get by this license requirement.

    4. Re:Qt by d235j · · Score: 2, Informative

      Simple: They post source code at opensource.apple.com and since they keep away from LGPL 3, they can use signing to, in effect, do "tivoization." And the iPhone and apps have dynamically linked libraries.

    5. Re:Qt by noidentity · · Score: 1

      Remember one thing about LGPL. It requires that that user can replace the LGPL binary. So Qt released under LGPL must be a separate dll, no static linking.

      Or you could provide the source code for your program, or perhaps the .o files (if you like angering your users).

    6. Re:Qt by Anonymous Coward · · Score: 1, Informative

      I hate replying to myself, but forgot one thing:

      If you want to know what Qt has to offer without downloading it, you can check out their documentation online:
      http://doc.trolltech.com/4.5/

      Take a look at the list of classes as well.
      Don't worry, you can disable the modules you don't need (including the GUI) to reduce the overhead.

    7. Re:Qt by dbialac · · Score: 0, Offtopic

      QT is a good platform but don't turn past Mono/.Net either. .Net isn't OSS but Mono most certainly is.

    8. Re:Qt by ultrabot · · Score: 1

      Use Qt.

      Seconded.

      Note: you can also use just QtCore, without QtGui, if you don't need the gui parts.

      --
      Save your wrists today - switch to Dvorak
    9. Re:Qt by HeronBlademaster · · Score: 2, Informative

      OP didn't say anything about UI, as you'd surely know if you had bothered to read the summary:

      What I actually need is a platform independent lib covering Windows and Linux variants to handle sockets, IPC and threads abstractions

      I wrote my own little socket class in C++ that does the Windows/Linux abstraction for me; they're mostly the same anyway, unless you want to get into epoll and such. I had planned to write a similar class for threads, but the idea is not exactly appetizing. I'm told boost has a thread class that might do the trick.

    10. Re:Qt by Anonymous Coward · · Score: 4, Informative

      Point for point:

      - sockets
      - IPC
      - threads abstractions
      - Database. Well, not quite so simple, but Sqlite3 as backend is available.

    11. Re:Qt by morgan_greywolf · · Score: 2, Informative

      Or GTK. Or specifically, gtkmm. Recent builds of GTKmm and Glibmm include stuff for handling sockets (Gtk::Socket). threads (Gtk::Thread, Gtk::Mutex, etc.) and IPC (GTK::Plug). Don't forget the GIO stuff, too.

    12. Re:Qt by rtfa-troll · · Score: 4, Informative

      OP didn't say anything about UI, as you'd surely know if you had bothered to read the summary:

      QtCore has more or less nothing to do with UI.

      --
      =~ s,(.*),<sarcasm>$1</sarcasm>,g if any_point_you_wish();
    13. Re:Qt by zach_the_lizard · · Score: 1

      I was about to recommend this, too. It has SQL plugins. The framework can handle networking, graphics, GUIs, scripting, and even threading. And if you write your application well enough, it is possible to compile it for multiple platforms with no or little changes. I've got a cross-compiler set up on my Linux box, and I use it to compile the Windows versions of some of my apps. WINE can also be used for basic testing, though I would always test in on a real Windows machine (or several).

      --
      SSC
    14. Re:Qt by Lord+Kano · · Score: 3, Informative

      It's LGPL (So it's free for commercial projects as well)

      I'm sorry to nitpick, but this is an important distinction. You can use GPL code in a commercial project. I don't think that there's any dispute that RHEL is a commercial product. LGPL allows you do use code in proprietary projects.

      LK

      --
      "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
    15. Re:Qt by zach_the_lizard · · Score: 1

      Qt is a framework, not just a GUI library. The QtCore classes can be used without any dependencies on the QtGui classes. And yes, Boost does have a threading class or two. I think it is even being adopted for the next C++ standard.

      --
      SSC
    16. Re:Qt by Anonymous Coward · · Score: 0

      And J2ME naturally...

    17. Re:Qt by Tacvek · · Score: 1

      Correct. C++0x will have native support for threads, based largely on Boost threading libraries, but with some differences, and the potential for better support of some features, by adding support to the language core.

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    18. Re:Qt by Anonymous Coward · · Score: 0

      Err... He asked for C/C++. Otherwise, why settle for crappy mono when you can get full-featured and supported Java?

    19. Re:Qt by NoYob · · Score: 1

      GTK doesn't have the well written documentation that Qt has.
      The build environment is overly complicated. It took me a few hours hunting down dependencies to get a damn hello world gui program to work.. They have the includes all over the place. And there was a bunch more. Glade isn't intuitive at all. A gui is loaded real time from an xml file - I'm not so sure I like that implementation.
      I gave up on Gtk.
      And, isn't it really a C framework with a C++ front end?

      --
      It's NOT me! It's the meds! I'm on 1000mg of Fukitol.
    20. Re:Qt by jmv · · Score: 4, Interesting

      I've once attempted to use Gtkmm for a new project. While the API is generally well designed, I found that the documentation for many features was totally inexistant. Even more annoying was the fact that some components were either buggy or not wrapped (from C Gtk) at all. Combined with the fact that components get created and deprecated at a huge rate, you don't even know what you should be using. Overall, I've had a really bad experience with Gtk (and especially gnome) development. I've only tried using Qt a little bit and so far I like it a lot. I've never done GUI with it though. I've used the "platform independent system library" part for things like threads, sockets and the like. The only thing I found a bit annoying was that it didn't integrate well with the STL.

    21. Re:Qt by FreezeS · · Score: 1

      How did you get the list of network adapters ?

    22. Re:Qt by morgan_greywolf · · Score: 1

      GTK didn't used to have the well written documentation that Qt has.

      TFTY. See the GtkMM Documentation as well as the mainline GTK documentation. The newer documentation, including that for the PyGTK Python bindings, is some of the best-written API documentation I've ever seen.

    23. Re:Qt by Xtravar · · Score: 1

      A gui is loaded real time from an xml file - I'm not so sure I like that implementation.

      You don't have to go that route. You can construct a UI from API calls just like any other toolkit.

      FWIW, I prefer using Mono & Gtk# over anything else when I develop in Linux. Though, that's not saying much.

      --
      Buckle your ROFL belt, we're in for some LOLs.
    24. Re:Qt by Anonymous Coward · · Score: 1, Informative

      LGPL allows you do use code in proprietary projects.

      No it doesn't, but it does allow you to link against it. There's a difference. If you wan't to use open source in a proprietary project then you'd have to go with something like the BSD license.

    25. Re:Qt by ari_j · · Score: 1

      I like that it's still called C++0x. Are they going to publish the final standard in the next 80 days?

    26. Re:Qt by Lord+Kano · · Score: 1

      You are correct. I didn't properly explain the difference.

      LK

      --
      "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
    27. Re:Qt by digitalunity · · Score: 3, Funny

      Mono on windows isn't there yet.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    28. Re:Qt by zach_the_lizard · · Score: 1

      What about it doesn't integrate well with the STL? I've encountered a few strange things, but I'd like to here about what sorts of issues you've encountered.

      --
      SSC
    29. Re:Qt by Doppler00 · · Score: 2, Interesting

      Qt is okay for networking applications, but in my experience Boost has much, much better performance, not to mention better support for things like multicast without creating some hacks. Qt ends up using a lot of Qt specific classes internally to create buffers and network functions, so it ends up being slower than Boost which seems to act more as a wrapper than anything.

    30. Re:Qt by Anonymous Coward · · Score: 1, Insightful

      Because, I mean, why would you go for a totally free and unencumbered platform that natively supports the language you want to use, when you could get a patent-heavy proprietary platform, controlled by a corporation with a history of making patent threats towards open source products, that only supports a proprietary and non-standard version of your language, and for which the open source implementation is immature and incomplete?

      Oh, wait, I think I answered my own question.

    31. Re:Qt by KirstuNael · · Score: 1

      I didn't.
      It was not required for my app to know about network adapters. Is that possible to do in cross-platform way using Qt -- I have no idea.

    32. Re:Qt by Anonymous Coward · · Score: 0

      I concur. My Qt-powered multithreaded and networked (TCP&UDP) application is compiling and working nicely in linux, osx and win32 without any os-specifc #ifdefs.

      How about Solaris on SPARC? How do you handle the endian difference?

    33. Re:Qt by dwinks616 · · Score: 0

      At no point does this person you quoted mention Solaris...

    34. Re:Qt by Anonymous Coward · · Score: 0

      To which the trolls will respond: but you can use Boost as a layer under cute.

    35. Re:Qt by odourpreventer · · Score: 1

      > The only thing I found a bit annoying was that it didn't integrate well with the STL.

      Is there anything that does? Boost has some alternatives to STL classes, and I'm sure Qt has as well.

      STL has a nice API, but that's about it.

    36. Re:Qt by quantumphaze · · Score: 1

      FTFY. See the GtkMM Documentation as well as the mainline GTK documentation.

      FTFY :p

    37. Re:Qt by dcollins117 · · Score: 1

      To which the trolls will respond: but you can use Boost as a layer under cute.

      That's not so much a troll as an astute and rather helpful suggestion.

    38. Re:Qt by jmv · · Score: 1

      There's no issue in particular, just the fact that it uses QString instead of std::string, QMap instead of std::map, and so on. That's annoying, but you learn to live with it.

    39. Re:Qt by Simon80 · · Score: 1

      You don't. When you tell your network stream instance to interpret the next four bytes as integers (as in stream >> myInt32), the function responsible for that is perfectly capable of swapping the bytes for you. If you have to deal with endianness directly, you're definitely not using enough abstraction.

    40. Re:Qt by Anonymous Coward · · Score: 0

      And don't forget: no forbidding reverse-engineering in your EULA (if you insist on one) when you use LGPL libraries!

    41. Re:Qt by mrwolf007 · · Score: 1

      Whats the problem?
      The x in C++0x isnt decimal, its hexadecimal.

    42. Re:Qt by Anonymous Coward · · Score: 0

      Sure, if you want to ignore the entire history of the language standard, the standards committee's stated meaning of the 0x, the fact that hexadecimal digits in standard notation only go up to F, and the fact that '0x' is, in C and other languages using that syntax, a sigil that indicates the following number is hexadecimal and not part of the number itself, then you are absolutely correct.

    43. Re:Qt by mehemiah · · Score: 1

      he probibly ran into missing documentation on the stuff he wants. Among Open Source projects, this is often what seperates Django from Rails ... click on the links to see which one I think is better, or make your own judgment call. http://library.gnome.org/devel/gtkmm/unstable/

    44. Re:Qt by Anonymous Coward · · Score: 0

      I just wanted to 2nd that opinion. Qt rocks. It works great on Windows, Linux, and MacOS X and integrates very well with Eclipse to make a great IDE with drag-&-drop GUI editing.

    45. Re:Qt by TemporalBeing · · Score: 2, Informative

      Qt is okay for networking applications, but in my experience Boost has much, much better performance, not to mention better support for things like multicast without creating some hacks. Qt ends up using a lot of Qt specific classes internally to create buffers and network functions, so it ends up being slower than Boost which seems to act more as a wrapper than anything.

      But does Boost provide behind the scenes threading?

      One of the things I've noticed with Qt is that they went out of their way to make the best possible performance. There's a lot of Qt classes (such as QTcpSocket) that implement threading behind the scenes so the performance is really hard to impact your application with (not impossible but a lot harder).

      Additionally, while there are a lot of things you do need to use the Qt classes for, it's typically very easy to convert many of those classes to and from C++ STL. Nearly all classes that have an STL equivalent have a function to convert the class to that STL equivalent or to to be initialized by an STL equivalent.

      Furthermore, you can easily intermix Qt Signals/Slots with other Signal/Slots implementations - such as the version provided by Boost. If you use the standard terminology then Qt will gladly use the third party Signals/Slots mechanisms itself; otherwise, you can use a couple macros (Q_SLOTS, Q_SIGNALS) to specify that you always want these signals/slots to be run via the Qt Signals/Slots.

      Honestly, I can't say that any other API platform has so much provided and so many methods for working with language native and third party mechanisms.

      The only thing that took a little getting use to was: (i) using a lot of pointers without having to keep track of quite all of them since the Qt Object Meta-systems does a lot of the cleanup for you (so long as the QObject has been parented), and (ii) Signals/Slots across threads requires a special QThread class implementation that only has signals with an internal class instance that has the signals/slots you would normally expect. Otherwise, Qt is the most intuitive, well documented, platform agnostic, and high performing framework out there.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    46. Re:Qt by Louai · · Score: 0

      QString has function to convert to/from std::string, and the Qt containers can all give you STL compatible iterators. I've found working with Qt and the STL in general to be quite easy - in fact I prefer to use the Qt classes whenever I can, as I much prefer their API.

    47. Re:Qt by iSeal · · Score: 1

      OP didn't say anything about UI, as you'd surely know if you had bothered to read the summary:

      What I actually need is a platform independent lib covering Windows and Linux variants to handle sockets, IPC and threads abstractions

      *ahem*

      And if you bothered to read what Qt was about, then you'd realize that Qt is in fact a platform independent lib covering Windows and Linux variants to handle sockets, IPC and threads abstractions (as well as a whole lotta other things.)

      Classes that Qt offers:
      http://qt.nokia.com/doc/4.5/classes.html

    48. Re:Qt by HeronBlademaster · · Score: 1

      My response was based on my parent post's emphasis on UI and cross-platform UI tools :P

    49. Re:Qt by Draykwing · · Score: 1

      GP using the word 'troll' could have been a cleverly constructed joke, seeing as prior to being bought by Nokia, the employees at TrollTech were known as 'the trolls'. Not sure I believe it is a joke, though.

    50. Re:Qt by quantumphaze · · Score: 1

      I was aiming for Funny by pointing out that he spelt FTFY (TFTY) wrong. Being a FTFY post it should count for some level of irony.

      Anyway, many of these projects could be so much more useful and even get outside contributions if the docs were in better shape.

    51. Re:Qt by mehemiah · · Score: 1

      Ok, I should have replied to parent. (I forgot what that stood for, now that I remember, it was indeed funny)

    52. Re:Qt by mehemiah · · Score: 1

      he probibly ran into missing documentation on the stuff he wants. Among Open Source projects, this is often what seperates Django from Rails ... click on the links to see which one I think is better, or make your own judgment call. http://library.gnome.org/devel/gtkmm/unstable/

    53. Re:Qt by agbinfo · · Score: 1

      I realize that we're way past '07 but shouldn't the x be octal since the number starts with a 0 (zero). Then again, 4000 octal is 2048 decimal so maybe they're still early.

  3. Boost? by piojo · · Score: 2, Informative

    I know Boost has threading support, but I'm not sure how much. Have you looked at that? (It also has a bunch of other useful libraries, perhaps Filesystem being pretty useful for cross-platform work.)

    --
    A cat can't teach a dog to bark.
    1. Re:Boost? by Homburg · · Score: 4, Informative

      Boost has pretty strong threading support, which is the basis for the threading capabilities in the forthcoming revision of the C++ standard. Boost also has cross-platform IPC and socket libraries. It would be a good choice for the OP, I think.

    2. Re:Boost? by Anonymous Coward · · Score: 0, Troll

      Avoid Boost. Cross Platform: no. Well Tested: absolutely not.

    3. Re:Boost? by QuoteMstr · · Score: 1

      [citation needed]

    4. Re:Boost? by Anonymous Coward · · Score: 0

      There are certainly bits and pieces of Boost that are a total mess, style/syntax wise (*cough* Boost.Exception *cough*). I'm unaware of any that don't *function* well, though.

    5. Re:Boost? by Profane+MuthaFucka · · Score: 2, Funny

      No, USE Boost for exactly those reasons. It's an extremely advanced library, and working with it will quickly make you a much better C++ programmer.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    6. Re:Boost? by mwvdlee · · Score: 1

      I was under the impression that Boost didn't even accept libraries that weren't coded according to Boost's style?

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    7. Re:Boost? by incripshin · · Score: 1

      Boost ... is the basis for the threading capabilities in the forthcoming revision of the C++ standard.

      It's probably the other way around, see the Boost thread documentation. In any case, it's much easier than using pthreads' C API, and I think the feature set is approximately the same as pthreads.

    8. Re:Boost? by alexmin · · Score: 1

      Boost rocks. Using it on win & lin for few years already. Currently planning to replace ACE with it. Take a look at AIO and Thread libraries, that what you need. As a bonus you get to know all other juicy libs like bind, lambda, format, date_time etc.
      There are a lot of new stuff added to boost in past couple of years so it's definitely worth a look.

      Have only one issue with it - jam.Why, why did they decide to stick with homegrown, badly documented, convoluted python-based build system????

    9. Re:Boost? by i.of.the.storm · · Score: 1

      Err, isn't that how you normally do it? Eg. to link in the math lib you add -lm.

      --
      All your base are belong to Wii.
    10. Re:Boost? by Pseudonym · · Score: 2, Interesting

      That's correct. Boost has the most stringent code review practices of probably any open source project.

      This seems like an anti-open-source thing to do, but it's critical considering what Boost has to do. It's partly that library of infrastructure that all serious C++ projects need before they start, and partly the place where additions to the standard library are born. Boost development is slow, but Boost code is bulletproof.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    11. Re:Boost? by Anonymous Coward · · Score: 0

      Yeah, once you have spent years learning the ins and outs of arcane C++ techniques it certainly feels like you have accomplished something!

    12. Re:Boost? by oxygen_deprived · · Score: 1

      I second that.While I am not on embedded, my product does linux, osx, hpux, aix, solaris and windows. We started shifting to boost ( threads, serialization ,filesystem ) about 3 years ago in bits and pieces. The code is so much cleaner, easier to understand, and reliable. You may have some work to do to move to your platform (embedded is a different animal AFAIU ). The downside would be the app footprint and maybe a bit of performance hit (may be noticeable on low spec devices )

  4. many choices by Anonymous Coward · · Score: 2, Interesting

    NSPR, APR, boost system, threads

  5. Qt by Anonymous Coward · · Score: 5, Informative

    Use Qt. It's LGPL (So it's free for commercial projects as well), is well documented and offers a ton of abstractions (including sqlite).

    http://qt.nokia.com/

    And tool support is excellent as well (Visual Studio Add-In, Eclipse Plugin and a standalone IDE called QtCreator).

  6. JUCE by Anonymous Coward · · Score: 0

    JUCE (www.rawmaterialsoftware.com) can handle IPC and threads, don't know about sockets. No integrated DB though, and it's primarily a GUI and media thing. Lots of integrated real time audio stuff etc. so it might be too heavy weight for your purposes.

  7. Pthreads by SoftwareArtist · · Score: 3, Informative

    I've used Pthreads successfully as a cross-platform threading library. http://sourceware.org/pthreads-win32 is a quite good implementation for Windows, and it's built into Linux (and all other POSIX compatible OS's, such as OS X, as well).

    --
    "I'm too busy to research this and form an educated opinion, but I do have time to tell everyone my uninformed opinion."
    1. Re:Pthreads by QuoteMstr · · Score: 2, Interesting

      pthreads-win32 is excellent, but regrettably, LGPL licensed. It's interesting to note how complex it has to be to give you POSIX semantics --- pre-Vista win32 threading primitives are fundamentally flawed.

      Vista, on the other hand, gives us brand-new innovative 21st-century Microsoft technologies like condition variables.

    2. Re:Pthreads by bcmm · · Score: 1

      pthreads-win32 is excellent, but regrettably, LGPL licensed.

      What is wrong with LGPL?

      --
      # cat /dev/mem | strings | grep -i llama
      Damn, my RAM is full of llamas.
    3. Re:Pthreads by digitalunity · · Score: 1

      The license is more complex than the GPL. It's more difficult to understand and is easier to lead to ambiguity.

      For software developers writing closed source programs without access to a legal department, it can be daunting to determine if you have complied with the subtle LGPL requirements to keep your source closed.

      If you're developing GPL applications with LGPL libraries, you have nothing to worry about.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    4. Re:Pthreads by Svartalf · · Score: 1

      ..and if you're not statically linking and not restricting reverse engineering or laying claim to patent coverage in a way that you prevent downstream use of the stuff you supply- along with providing any mods to the library...there's no other issues to speak of.

      There's no "subtle" about LGPL any more than there is to GPL, really. GPL's just slightly more restrictive.

      --
      I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
    5. Re:Pthreads by gauauu · · Score: 1

      What is wrong with LGPL?

      For a statically-linked proprietary C++ application? Everything. You have to allow the user to re-link against a different version of the library, which basically means distributing object files for each of your source files. It's terrible.

      For things like java that always link libraries dynamically, it's fine. If the library you are linking against is a dll or shared object, it's fine. Otherwise, it's terribly annoying.

      My example: I was developing a homebrew game for Gameboy Advance. In that case, everything gets linked into one single rom image. The music library I considered using was LGPL. If I had used it, I would have had to distribute object files for my whole game, instead of simply distributing the rom image. So that library got disqualified because of the LGPL license.

    6. Re:Pthreads by TheSunborn · · Score: 1

      Can you not just distribute the static linked version, and then include an offer for a version that is dynamic linked with QT?. In most cases, nobody will want the dynamic linked version so you don't really have to do anything. And if somebody really contact you and want a dynamic linked version of your program, you should just need to change a single parameter and do a make, and send them the dynamic linked version.

  8. c++0x by Anonymous Coward · · Score: 0

    a *lot* has happened in C++ recently. you might want to check out TR1, c++0x, boost::thread and (boost::)asio

  9. Qt or GLib by ciroknight · · Score: 2, Informative

    Qt's "Core" library is a pretty solid platform shim. Plain GLib is also (somewhat easier to port due to no C++ ABI differences, but no native C++ api makes it less attractive to you).

    Either one is an exceptional choice.

    --
    "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
  10. TBB works wonders for threading by Wrath0fb0b · · Score: 5, Interesting

    Intel Thread Building Blocks (http://www.threadingbuildingblocks.org/ is (are?) fantastic. Open source (GPL), works on any ISO-compliant C++ compiler and is fairly intuitive. It allows both high-level (parallel_for) and low level (task-based) parallelism. Particularly useful are the concurrent containers, since it saves you from reimplementing these basic structures.

    1. Re:TBB works wonders for threading by non-e-moose · · Score: 1

      "You Lie!" They are NOT GPL-ed. The License is explicitly ANTI-GPL. Read it.

    2. Re:TBB works wonders for threading by Wrath0fb0b · · Score: 3, Informative

      From the FAQ - http://www.threadingbuildingblocks.org/wiki/index.php?title=Licensing:

      TBB is available under the common OSS license GPL v2 with the libstdC++ Runtime Exception. This is the same license used for a variety of well-known OSS applications including MySQL, NetBeans, and the Linux kernel.

    3. Re:TBB works wonders for threading by non-e-moose · · Score: 1

      RTF License, not the FAQ. Explicitly: An "Excluded License" is one that requires, as a condition of use, modification, or distribution, that (a) the code be disclosed or distributed in source code form; or (b) others have the right to modify it; or (xi) include the Redistributables in malicious, deceptive, or unlawful programs.

    4. Re:TBB works wonders for threading by PCM2 · · Score: 3, Informative

      You're quoting from the commercial license. TBB is quite explicitly dual-licensed. If you don't like the terms of the commercial license, you have the option to use it under the terms of the GPL v2.

      --
      Breakfast served all day!
    5. Re:TBB works wonders for threading by Anonymous Coward · · Score: 0

      No, the open source version of Threading Building Blocks (TBB) is licensed under the GPL v2 with the libstdC++ Runtime Exception. This is stated in the COPYING file:

      erik@linux:~# tail -20 /tmp/tbb22_20090908oss/COPYING

      This General Public License does not permit incorporating your program into
      proprietary programs. If your program is a subroutine library, you may
      consider it more useful to permit linking proprietary applications with the
      library. If this is what you want to do, use the GNU Lesser General
      Public License instead of this License.
      ---------------- END OF Gnu General Public License ----------------

      The source code of Threading Building Blocks is distributed under version 2
      of the GNU General Public License, with the so-called "runtime exception,"
      as follows (or see any header or implementation file):

            As a special exception, you may use this file as part of a free software
            library without restriction. Specifically, if other files instantiate
            templates or use macros or inline functions from this file, or you compile
            this file and link it with other files to produce an executable, this
            file does not by itself cause the resulting executable to be covered by
            the GNU General Public License. This exception does not however
            invalidate any other reasons why the executable file might be covered by
            the GNU General Public License.

    6. Re:TBB works wonders for threading by BhaKi · · Score: 1

      works on any ISO-compliant C++ compiler

      Does the generated code run on AMD processors perfectly? Intel has done many anti-competitive things and I'd be surprised if code generated by TBB works perfectly on non-Intel processors.

      --
      The largest prime factor of my UID is 263267.
    7. Re:TBB works wonders for threading by Dog-Cow · · Score: 1

      I understand where you are coming from on this, but either the CPU is Intel-compatible or its not. Unless TBB includes assembly code, it's rather unlikely they could write C++ that is intentionally crippled on AMD CPUs.

  11. Boost by aePrime · · Score: 4, Informative

    Boost has libraries for each of these three: sockets through the ASIO library, IPC through the Interprocess library, and threads through the threads library.

    http://www.boost.org

    The only thing that Boost is lacking for which you asked is a database library.

    1. Re:Boost by mls · · Score: 4, Informative

      SQLite databases are small, powerful and platform independent and might be a good choice to fit your database needs. The code is public domain.

      --
      -mls
    2. Re:Boost by Anonymous Coward · · Score: 0

      boost has persistent objects through it's object streaming api.
      If you stream an object to a file, you have an Object-Oriented Database.(OODB).
      Check around for c++ OODB and you will find stuff.
      Good luck.

    3. Re:Boost by Anonymous Coward · · Score: 0

      Boost can really be quite painful to work with at first, but I do agree it is the best thing for your needs. Boost puts a lot of focus on cross platform capabilities, and it also puts a lot of emphasis on efficiency.

  12. boost by Anonymous Coward · · Score: 0

    boost

  13. APR by Anonymous Coward · · Score: 0

    IANA C guru but maybe Apache Portable Runtime? Seems to be more lightweight than QT.

  14. ACE is great! by Arakageeta · · Score: 1

    I've had great experiences with ACE. I found ACE to be dependable and extensive. You don't even have to use the higher level design patterns to get the platform independence.

    If you're targeting *only* Windows and Linux, then Qt may also be a good option. I'm not sure if you can strip out the GUI stuff if you don't need it.

    1. Re:ACE is great! by mallan · · Score: 3, Interesting

      Qt has been modular since ver 4, so you don't have to include the GUI components if you don't want to. The API is clean, elegant and consistent, plus the documentation is great. I don't have anything bad to say about ACE or Boost - they're both high quality toolkits - but if I had to choose just one toolkit to use for the rest of my life, it'd be Qt, hands down.

      --
      "Good people drink good beer"
    2. Re:ACE is great! by Anonymous Coward · · Score: 1, Interesting

      Avoid ACE, it is really poor. Have you every tried to compile and build it on modern systems? It just does not build. It looks like the project has been abandoned to me.
      I tried to build it on 5 modern UNIX OSs recently and they all failed. The main reason is that the C++ code is poor written and C++ is not very portable because the C++ compilers only implement parts of the standard.

    3. Re:ACE is great! by cbhacking · · Score: 1

      QT allows use of just the core libraries, so that's not a concern. Why do you talk about "only" targeting Windows or Linux, though? QT runs on OS X, WinCE, and other platforms as well. For example, if Skype runs on it, you can bet QT does too.

      --
      There's no place I could be, since I've found Serenity...
    4. Re:ACE is great! by TrancePhreak · · Score: 1

      Skype is on PSP, is QT?

      --

      -]Phreak Out[-
    5. Re:ACE is great! by Arakageeta · · Score: 1

      I've had the impression that ACE supports more exotic platforms, but your question prompted me to check what platforms Qt will run on-- how long has Qt supported VxWorks? I guess a lot has changed recently. I suppose an in-depth comparison of ACE and Qt is warranted. Still, I have enjoyed using ACE.

    6. Re:ACE is great! by old+cob · · Score: 1

      ACE is nowhere near abandoned. It is widely used on major RT systems such as weapons, telecom and finance. It is now being used in medical systems (MRIs). It runs on all standard platforms and includes exotic RTOS which are tough to support. It is commercially supported by several organizations including the one I work for, OCI in St Louis. Malcolm Spence

  15. Apache Portable Runtime by boilednut · · Score: 1

    APR

    1. Re:Apache Portable Runtime by boilednut · · Score: 5, Informative
      From the wikipedia articel:

      APR was originally a part of Apache HTTP Server, but has now been spun off into a separate project of the Apache Software Foundation, and is used by other applications to achieve platform independence. The range of platform-independent functionality provided by APR includes:
      * Memory allocation and memory pool functionality
      * Atomic operations
      * Dynamic library handling
      * File I/O
      * Command argument parsing
      * Locking
      * Hash tables and arrays
      * Mmap functionality
      * Network sockets and protocols
      * Thread, process and mutex functionality
      * Shared memory functionality
      * Time routines
      * User and group ID services

    2. Re:Apache Portable Runtime by quench · · Score: 1

      thanks for the hint, but a function call with a handle as 1st arg ist really too c-ish even for me, I'll stick to Qt, ACE and Boost.
      thanks anyhow for clearing up the technology!!!

    3. Re:Apache Portable Runtime by Anonymous Coward · · Score: 0

      APR is horribly low-level and a can of worms once you open it.

      I like the arena allocator though.

    4. Re:Apache Portable Runtime by Boj · · Score: 1

      APR is a noble effort, but it isn't even widely adopted in Apache projects - for example Harmony. A particular weakness of APR is that it assumes a UNIX environment with all the toys that brings with it. For example, the APR interfaces for signal handling are a poor match to those of some operating systems and people using them could find their code distinctly unportable.

  16. As someone working on a massive project... by QuoteMstr · · Score: 4, Informative
    I'm working on a rather large cross-platform C++ project at the moment. Here are a few tips:
    1. Use Boost. It's a very liberally-licensed, high-quality library from the people who created the C++ language itself. It contains a ton of cross-platform libraries that do lots of useful things, from threads to regular expressions to writing testsuites and parsing command-line options. If Boost provides a piece of functionality, there's very little reason not to use its version.
    2. See rule #1.
    3. If you need cross-platform code that isn't in Boost, at least use the following approach:
      • Create a common interface definition
      • In separate files, implement the interface in terms of various platforms' primitives
      • Keep platform-specific code out of the rest of your program; if you can help it, don't even include platform headers in most of your program
    4. Use autoconf to handle platform idiosyncrasies. There are a ton of available macros to help detect things about a build platform.
    5. Write testcases. You should write tests for all your programs, but it's especially important to do it for cross-platform code because it's easy to break something and not notice.
    1. Re:As someone working on a massive project... by Anonymous Coward · · Score: 3, Insightful

      Use autoconf to handle platform idiosyncrasies.

      Ugh. Autoconf & automake are the most horrible things I've tried to use in recent times. These tools are far from simple and what works with newer versions of the tools isn't even compatible with older versions. The syntax is antiquated and there are multiple ways to achieve the same thing each with different pitfalls.

      Somewhere there is a meteorite set to strike autoconf. I hope it gets here soon since it's about 20 years late...

    2. Re:As someone working on a massive project... by Anonymous Coward · · Score: 5, Funny

      it is all well and good, but he cannot even read options 3,4 and 5 because of your recursion!

    3. Re:As someone working on a massive project... by Anonymous Coward · · Score: 0

      #$@$@#$@#, I meant to mod your post "funny" but the stupid moderation system doesn't let you recover from clicking the wrong one! Thus, I am posting a reply to undo my accidental "troll" moderation.

      Moderators, please feel free to mod this post down to oblivion, just to get those negative emotions out of your system. ;-)

    4. Re:As someone working on a massive project... by Pseudonym · · Score: 2, Informative

      Use Boost. It's a very liberally-licensed, high-quality library from the people who created the C++ language itself. It contains a ton of cross-platform libraries that do lots of useful things, from threads to regular expressions to writing testsuites and parsing command-line options. If Boost provides a piece of functionality, there's very little reason not to use its version.

      Agreed, but you left out one crucial reason: If you use Boost today, this maximises your chances that your code won't need very much porting to work with the C++ standard library of tomorrow.

      Use autoconf [...]

      I'd like to agree here, but IME autoconf and Boost.Build don't work so nicely together.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    5. Re:As someone working on a massive project... by Sneezer · · Score: 1

      i agree with the parent's other points but i strongly disagree with this one:

      Use autoconf to handle platform idiosyncrasies.

      autoconf is gross and difficult to use on Windows.

      i use CMake at work and like it well enough. it works well enough with Qt that KDE uses it for their build system.

    6. Re:As someone working on a massive project... by larytet · · Score: 1

      Emlib is a thin wrapper. No sockets though. http://larytet.sourceforge.net/

    7. Re:As someone working on a massive project... by larytet · · Score: 1

      VLC (videoLAN) uses wxWidgest Multi-thread application which is fairly close to what embedded application looks like

    8. Re:As someone working on a massive project... by aminorex · · Score: 1

      > 4. Use autoconf...

      OMFG.

      --
      -I like my women like I like my tea: green-
    9. Re:As someone working on a massive project... by QuoteMstr · · Score: 1

      What's wrong with autoconf?

      No, seriously --- people like to complain about the syntax, but using a shell script makes it flexible. What's so bad about it? Autoconf has been used for decades by thousands of software projects. It can't be all that bad, can it?

    10. Re:As someone working on a massive project... by DiegoBravo · · Score: 1

      > chances that your code won't need very much porting to work with the C++ standard library of tomorrow.

      Don't worry. For the C++ standards committee people, "tomorrow" means what ten years is for the rest of us.

    11. Re:As someone working on a massive project... by Anonymous Coward · · Score: 0

      In terms of the longevity of a "rather large cross-platform C++ project", ten years often is "tomorrow".

      - T

    12. Re:As someone working on a massive project... by b4dc0d3r · · Score: 1

      I bought the wxWidgets book and read it, hoping to be enlightened beyond all measure to discover a wonderful new paradigm of cross-platform application writing. I have been looking at this since I read a seemingly homebrew "XP: Cross Platform Programming" or something like that, during the days of Windows 98/ME.

      I was sorely disappointed. It's basically MFC ported to Linux. I can't even remember what I hated it at this point, it's been so long, but I look at that book with disappointment and derision when I sort through my library from time to time. I'd give or throw it away, but I take the risk that someone might accidentally read it, so I've taken on the burden of keeping that copy at least safe from prying eyes.

      GTK was too much casting for my tastes, and Qt had licensing issues. Now that Qt is open, I see no reason not to use it.

    13. Re:As someone working on a massive project... by b4dc0d3r · · Score: 1

      I personally don't believe it's portable at all. I've been told it is, but maybe I have my environment all wrong. When I download something that uses it, I usually end up building my own makefile, having it not work, and moving on to another project.

      Maybe it's running Windows that's my problem, but I've never had success without basically re-installing Cygwin from scratch before each use. Then I have hundreds of MB of stuff, just to compile a few hundred kB into a 40k app. No thanks. If I were doing Unices only, maybe it might be better.

    14. Re:As someone working on a massive project... by Pseudonym · · Score: 1

      Or to put it another way, next Debian release.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  17. Boost? by alex4u2nv · · Score: 0

    Last time I did c++ i used Boost.

  18. Unfortunately probably not worth it by Anonymous Coward · · Score: 0

    You can come up with your own runtime system that runs on all platforms and has its own library and primitives. However, you'd have to throw away the powerful system programming concepts of linux/unix that simply don't have anything equivalent on the Windows side. For example, fork() is not available, which is a shame since fork() is essential for starting background processes in a controlled fashion (have the parent initialize, fork and exit).

    Python and Java have the same problem and are reduced to lame multithreading where native asynchronous programming would do the trick in a clearer and more natural way.

    1. Re:Unfortunately probably not worth it by binarylarry · · Score: 1, Troll

      Java uses native thread exclusively. Anything you can do in C++ with threads, you can do faster and safer in Java.

      Python has no ability to uses threads in a practical sense, due to Python GIL.

      --
      Mod me down, my New Earth Global Warmingist friends!
    2. Re:Unfortunately probably not worth it by Anonymous Coward · · Score: 0

      Java uses native thread exclusively. Anything you can do in C++ with threads, you can do faster and safer in Java.

      That's the point: Java virtually forces threads on you. NIO can't multiplex arbitrary I/O devices, and fork() is not available.

    3. Re:Unfortunately probably not worth it by Anonymous Coward · · Score: 2, Interesting

      I have long given up using the threading module in python itself, and have actually been using the Parallel Python module written by Vitalii Vanovschi extensively for my parallel processing needs. If you need multi-core / cluster processing and want to stick with python, this library is quite excellent. http://www.parallelpython.com

    4. Re:Unfortunately probably not worth it by binarylarry · · Score: 1

      In newer versions of OpenJDK this is not true.

      Although in current use (java 6 et al), you're correct.

      --
      Mod me down, my New Earth Global Warmingist friends!
    5. Re:Unfortunately probably not worth it by Panaflex · · Score: 1

      I've rarely, if ever, seen a clear advantage of using forking. Using private structures per thread easily accomplishes the same task as forking and is highly portable. The one great forking advantage (crash resiliency) can still be accomplished by starting multiple processes from a script.

      For most projects I simply use a startup script or threading. Another project I've enjoyed using is OpenMP - which can automate across machines and has great run-time controls and basic messaging.

      --
      I said no... but I missed and it came out yes.
  19. Re:C++ is so old school... by homey+of+my+owney · · Score: 0, Offtopic

    Really? These are moded trolls for expressing an opinion? I thought that's in essence what the poster was looking for. ./ is getting increasingly tedious.

  20. Boost and POCO by Adam+Hazzlebank · · Score: 1

    Boost ( http://www.boost.org/ ) is good I also hear nice things about POCO http://pocoproject.org/

    1. Re:Boost and POCO by Profane+MuthaFucka · · Score: 2, Informative

      No, POCO is not very good. The documentation is poor, and it's buggy.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    2. Re:Boost and POCO by gbjbaanb · · Score: 2, Informative

      agreed, I used POCO for its email classes, and while it worked its documentation was somewhat out of date or incomplete. Still, I could figure out what was needed. what I didn't like was their adherence to the 'one true OO way' of developing libraries, too much of an exception hierarchy just isn't good.

      I didn't try the other parts and am probably not likely to. If boost had some general purpose classes (instead of mostly algorithms and general purpose classes) then I wouldn't have even looked at Poco.

    3. Re:Boost and POCO by vanye · · Score: 1

      I agree on the documentation - Poco has good reference docs, but its lacking a tutorial and other HOWTOs, so it can take a while ot get upto speed on its style.

      Disagree on the bugs - we've been using it as the core library in our enterprise software product for several years with no issues.

      Poco's clean, it gives me everything I need and it just works, what more do you want?

      richard.

    4. Re:Boost and POCO by Profane+MuthaFucka · · Score: 1

      example: The PocoZip library looks really good at first. Easy to read a zip file from the disk.

      BUT, what happens when you've got a zip file in memory that you're reading?

      You try to use a string stream to read memory instead of an istream to read from disk. The thing makes moves like it's going to work, but soon face intractable bugs caused by the brain-damaged nature of what PocoZip uses for a zip input stream.

      This situation is a bit beyond what a normal user might run into, but it's a sign that their implementation isn't robust enough to adapt to perfectly ordinary usage situations.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    5. Re:Boost and POCO by FatFreddie · · Score: 1

      Documentation can always be better but I think it's quite good and I find the libraries pretty solid. My heating system uses POCO and that's not something I'd trust to buggy software :-) Generally I'm very pleased with it and particularly pleased with the cross platform support - no #ifdef's required.

    6. Re:Boost and POCO by Profane+MuthaFucka · · Score: 1

      Read the response to the other guy re: the zip library.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  21. wxWidgets might work by Beached · · Score: 2, Informative

    wxWidgets (aka wxWindows) does windowing, sockets, thread. I am not sure about DB, but I think it does. I haven't used it for DB yet.

    --
    ---- aut viam inveniam aut faciam
    1. Re:wxWidgets might work by Profane+MuthaFucka · · Score: 1

      It also does infuriating bugs. Programs that work fine with small amounts of data explode when you get them into production. Doom!

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    2. Re:wxWidgets might work by Thundersnatch · · Score: 2, Insightful

      It also does infuriating bugs. Programs that work fine with small amounts of data explode when you get them into production. Doom!

      And why, exactly, are your programs not exposed to realistic data sets until they are in production? I don't think you can blame wxWidgets for that massive failure.

    3. Re:wxWidgets might work by Thundersnatch · · Score: 1

      I don't know, I don't use WX at all, so I'm not dodging anything.

      My point is that it is your fault that code made it into production. Everything has bugs, which is why you must test with realistic data sets, at all levels.

      Clean up your own yard before knocking on your neighbor's door.

    4. Re:wxWidgets might work by Mafia$oft · · Score: 1
      wxWidgets sockets: Linux: broken. Mac: broken. Windows: works (talking about multi-threading race conditions within the 3 layers of socket classes).

      Morale of the story: use wx for GUI parts, but consider using something else for those non-GUI parts which it has trouble with or which are less likely to be properly served by a _GUI_ framework. For networking stuff, libcurl is VERY hard to beat (binaries for perhaps up to 50 (FIFTY) platforms, used by "all fortune 500", ...).

      Spoken by someone who's been using wx all the time for 5 years now and generally likes it very much, but... well... you wouldn't let a butcher (GUI) take care about your dents (sockets) either, right!?!?

    5. Re:wxWidgets might work by radtea · · Score: 1

      Programs that work fine with small amounts of data explode when you get them into production.

      As the OP pointed out, testing is your friend.

      I'm using wxPython on a project that has hundreds of items in a tree. No problems, although it's slower than I'd like, mostly due to interface overheads (pushing stuff through SWIG is expensive, and if I were to improve wxPython in any way it would be to add "batch" interfaces that would let me push a whole wack of stuff through to the C++ side with a single call.)

      I've used wxWidgets on Windows for years, after years of Qt, and for what I do wx is great: solid, well-documented and extremely functional. Qt lost me with their license shenanigans a few years back, when TrollTech broke the lib up into parts and started charging for every little piece of it instead of selling the bundle. Fortunately, wx was just about ready for prime time about then--if you used wx more than a few years ago I can understand your frustrations, because it was really not ready for production code, but today it is definitely worth checking out unless you're already invested in Qt or really need to ship statically linked (it's my understanding that Qt is now LGPL).

      --
      Blasphemy is a human right. Blasphemophobia kills.
    6. Re:wxWidgets might work by Profane+MuthaFucka · · Score: 1

      Hundreds of items? That's it? Put 150,000 in and your trees are going to have diagonal lines going everywhere, and crap all over the page.

      Testing was indeed my friend. It said "USE QT."

      The last time I touched WX it was about 6 years ago, and there's no reason to go back. Honestly, you say it's working, but they said it was working 6 years ago. And reports from people I trust who have worked with it recently indicate that my bug is fixed, but new bugs just as bad have been substituted.

      And now I have 6 years experience with Qt, during which time I've never run across that kind of weirdness.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  22. --BOOST --ACE by sribe · · Score: 1

    As others have said BOOST is good. Also, I really didn't care for ACE and eventually gave up on it.

    1. Re:--BOOST --ACE by sribe · · Score: 1

      Ack phooey, that was supposed to be ++BOOST...

  23. Poco C++ Libraries is an excellent option by Anonymous Coward · · Score: 0

    I use Poco C++ Libraries and highly recommend it. It offers conceptual integrity throughout the component libraries, with a very generous open source license.

    It doesn't include a GUI library. Poco is more of a platform abstraction API. I cross-built Poco C++ Libraries for ARM9 and have experienced very good results the last 1.5 years. Zero Poco issues. Using the Poco abstractions for threads, mutexes, and network operations (both UDP and TCP).

    Poco includes SQLite integration and Expat XML parser integration. I experimented with both successfully, although they are not used in my commercial product that uses Poco.

    If Qt had been free when I began, I would have considered it. Poco was already free so it was an easy choice once I became familiar with it. Poco is actively maintained, and commercial support is available if wanted.

    Poco C++ Libraries. Highly recommended.

  24. You probably do not want ACE by Anonymous Coward · · Score: 1, Interesting

    ACE introduced a lot of neat concepts into the mainstream as far as I/O goes (the Reactor pattern came from ACE) but it's really quite crufty and showing its age. It's probably the best thing there is for wrangling heavily-threaded apps, but you'll have to deal with threads more than you'll care for. You'll find the APIs in Boost and QT to be a lot nicer.

    As for Berkeley DB, it's very nice, battle-tested, and perfectly suited for the type of task you're looking at.

    1. Re:You probably do not want ACE by quench · · Score: 1

      great summary, thanks!

  25. Cross platform? USE JAVA, duh! by Anonymous Coward · · Score: 0

    TFA - Whats the best hack for c++ to let it be cross platform?

    Everyone - Use this mish-mash of open source libraries and/or reinvent the wheel when you have to with interfaces and separate code files for OS specifics.

    Me - Use a language and SDK that is MADE FOR CROSS PLATFORM COMPATIBILITY. JAVA JAVA JAVA

    JAVA has cross platform sockets
    JAVA has cross platform threads
    JAVA has cross platform gui

    C++ has header files... F**K HEADER FILES
    C++ has pointers to pointers... F**K MEMORY MANAGEMENT
    C++ makes you feel smart when you get something to actually work correctly... F**K YOUR EGO

    1. Re:Cross platform? USE JAVA, duh! by ultrabot · · Score: 1

      Everyone - Use this mish-mash of open source libraries and/or reinvent the wheel when you have to with interfaces and separate code files for OS specifics.

      You don't need "mish mash" if libs if you use Qt.

      Get with the program. Java isn't "special" anymore.

      --
      Save your wrists today - switch to Dvorak
    2. Re:Cross platform? USE JAVA, duh! by Anonymous Coward · · Score: 0

      Java is perfect if you want a crummy looking, slow, dependent-on-Sun, huge-runtime, library-version-dependent application. No doubt about it.

      Has anyone ever created a single Java application that doesn't suck yet? (And, yes, Eclipse is slow and has a really crummy UI)

    3. Re:Cross platform? USE JAVA, duh! by binarylarry · · Score: 1

      Considering Eclipse is probably the most widely used IDE in the world, do you have anything to back up your claims?

      --
      Mod me down, my New Earth Global Warmingist friends!
    4. Re:Cross platform? USE JAVA, duh! by Anonymous Coward · · Score: 0

      15 years of hype, one "non-pure" application that's only used by programmers. Yeah, Java!

    5. Re:Cross platform? USE JAVA, duh! by rfreedman · · Score: 1

      TFA - Whats the best hack for c++ to let it be cross platform?

      Everyone - Use this mish-mash of open source libraries and/or reinvent the wheel when you have to with interfaces and separate code files for OS specifics.

      Me - Use a language and SDK that is MADE FOR CROSS PLATFORM COMPATIBILITY. JAVA JAVA JAVA

      JAVA has cross platform sockets
      JAVA has cross platform threads
      JAVA has cross platform gui

      C++ has header files... F**K HEADER FILES
      C++ has pointers to pointers... F**K MEMORY MANAGEMENT
      C++ makes you feel smart when you get something to actually work correctly... F**K YOUR EGO

      +1

    6. Re:Cross platform? USE JAVA, duh! by binarylarry · · Score: 1

      yeah, it's only part of the leading smartphone stack (Android, J2ME, etc), a large number of the top 10-20 most popular apps on sourceforge, runs most of the world's largest enterprise applications and runs most of the big software IDEs.

      It's all hype! Yeah, Java!

      --
      Mod me down, my New Earth Global Warmingist friends!
    7. Re:Cross platform? USE JAVA, duh! by LinuxAndLube · · Score: 1

      Have you heard of Hadoop?

  26. JNetLib by darkain · · Score: 1

    http://www.nullsoft.com/free/jnetlib/ From the guy who initially made Winamp, he also made a lib called JNetLib which is a piss easy to use cross-platform C++ socket library. It also has pre-made classes for things like HTTP/HTTPS, to help speed things up, or to simply give you an idea of how to use the library. It is licensed under the BSD license, so you are basically free to use it for whatever you would like, commercial or otherwise.

  27. Cygwin or UWIN by jdb2 · · Score: 4, Interesting

    If you want "close to the metal" POSIX API compatibility then there's Cygwin which is easier to use IMO and more actively developed but doesn't support the *full* POSIX spec or there is UWIN which supports most of the POSIX spec.

    Combine this with OpenGL, OpenAL, the SDL and Cygwin/X, QT, a Java layer using the SWT from Eclipse, *shudder* GLUT *shudder* ;) or IMNSHO preferably wxWindows/wxWidgets and you've got yourself a full cross-platform programming toolkit that can do just about anything.

    jdb2

    1. Re:Cygwin or UWIN by TrancePhreak · · Score: 1

      Cygwin does terrible things with its DLL and explodes in certain evironments.

      --

      -]Phreak Out[-
    2. Re:Cygwin or UWIN by Anonymous Coward · · Score: 0

      Just stop recommending wxWidgets! The API is horrible and it's buggy.

    3. Re:Cygwin or UWIN by Doppler00 · · Score: 1

      Cygwin is a huge pain. Yeah, it sort of gives you a POSIX environment, but good luck getting anything to actually compile under it without hours of frustration.

    4. Re:Cygwin or UWIN by TheNetAvenger · · Score: 3, Informative

      If you want "close to the metal" POSIX API compatibility then there's Cygwin

      Ok, but this is borderline 1990s thinking or a bit insane...

      You would be better off telling the person to just use the SUA of NT and develop a full *nix OSS solution and ignore Win32. As this is effectively what you are getting with Cygwin, except the SUA of NT is a full BSD subsystem that DOES RUN AT METAL 'so to speak' and doesn't have all the horrible 'kludges' of Cygwin.

      I mean seriously, I think people forget that NT does a very good V5 and BSD Unix already, that is far beyond POSIX compliance and yes even beyond Cygwin crap.

      ----

      To give a good answer to the OP, it would help to know what they are doing a bit more, as just knowing if they ware writing GUI or non-GUI code makes a BIG difference in picking a common or easily portable library. Also performance, what kind of performance do they need? Depending on what they are doing I could recommended truly using the SUA or Java or *gasp* .NET via Mono or QT or a ton of other solutions that do work and work well. Hell they might be doing an application can should be shoved into something like Silverlight.

    5. Re:Cygwin or UWIN by Anonymous Coward · · Score: 0

      The problem with SUA is that it is not available for 64-bit Windows XP or Server 2003 (pre 2003 R2). If you want to use SUA, then you can't support it on these versions of Windows.

  28. You might want to look at Zoolib by Orion+Blastar · · Score: 2, Informative

    Zoolib at Source Force under the MIT open source license. It has a flat file database format, exists for multiple platforms, has platform-independent thread and mutex classes, graphical user interface toolbox, thread-safe reference counted smart pointers, file access, TCP networking. You can ask the main developers Andy Green or Michael Crawford to port it to a new platform that isn't supported yet, but it supports all of the platforms listed on the source forge page.

    The Zoolib Cookbook can help you get started.

    The flat file database support is designed in Zoolib so that you can email someone the database file and they can click on it and open it up as an email attachment.

    --
    Remember, Slashdot does not have a -1 disagree moderation, and no, troll, flamebait, and overrated are not substitutes.
    1. Re:You might want to look at Zoolib by Anonymous Coward · · Score: 0

      cool! I'm planning on writing a cross-platform gui front end for libogg. Zoolib looks like a great fit!

    2. Re:You might want to look at Zoolib by Anonymous Coward · · Score: 0

      Is Zoolib ready for prime time? Here's the TOC for the Cookbook:

      1. Introduction
      2. ZHelloWorld

              ZMain: the Application Entry Point
              ZHelloWorld_App: the Application Object

                      Installing the Menus
                      ZRef: the Thread-Safe Reference Counted Smart Pointer

              ZHelloWorld_Window: the Window Objects

                      The Window Class Declaration
                      Our First Look at ZPaneLocator
                      Constructing and Destructing the Window
                      Creating the Window's Menus
                      Enabling the Menu Items
                      Handling Menu Messages

      A. GNU Free Documentation License

              0. PREAMBLE
              1. APPLICABILITY AND DEFINITIONS
              2. VERBATIM COPYING
              3. COPYING IN QUANTITY
              4. MODIFICATIONS
              5. COMBINING DOCUMENTS
              6. COLLECTIONS OF DOCUMENTS
              7. AGGREGATION WITH INDEPENDENT WORKS
              8. TRANSLATION
              9. TERMINATION
              10. FUTURE REVISIONS OF THIS LICENSE
              How to use this License for your documents

    3. Re:You might want to look at Zoolib by Orion+Blastar · · Score: 1

      I admit the Cookbook is incomplete but at least it is a start to get a look at Zoolib. Nobody else has tried to write a book or documentation on it yet. But The Zoolib page at Source Forge has more info and a mailing list to ask questions at.

      --
      Remember, Slashdot does not have a -1 disagree moderation, and no, troll, flamebait, and overrated are not substitutes.
  29. Poco C++ Libraries is an excellent option by Anonymous Coward · · Score: 0

    I use Poco C++ Libraries and highly recommend it. It offers conceptual integrity throughout the component libraries, with a very generous open source license.

    It doesn't include a GUI library. Poco is more of a platform abstraction API. I cross-built Poco C++ Libraries for ARM9 and have experienced very good results the last 1.5 years. Zero Poco issues. Using the Poco abstractions for threads, mutexes, and network operations (both UDP and TCP).

    Poco includes SQLite integration and Expat XML parser integration. I experimented with both successfully, although they are not used in my commercial product that uses Poco.

    If Qt had been free when I began, I would have considered it. Poco was already free so it was an easy choice once I became familiar with it. Poco is actively maintained, and commercial support is available if wanted.

    Poco C++ Libraries. Highly recommended.

    If you use Berkeley-DB, watch out for the Oracle licensing.

  30. Sorry, C variants aren't trendy... by CptNerd · · Score: 5, Funny

    Unfortunately all the trendy cool kids are using Java these days, and only web-based applications are worth working on if you want to keep up with the times. The days of small, simple client-server apps are over, old hat, out of date, archaic. Nowadays you need to implement a web application using AJAX, web services, Struts and Spring and Hibernate, and you have to do it using Agile methodology. If you aren't linking in at least 100 Java class libraries, you don't have a "real" application.

    C++? Too simple.

    --
    By the taping of my glasses, something geeky this way passes
    1. Re:Sorry, C variants aren't trendy... by quench · · Score: 1

      :)))

    2. Re:Sorry, C variants aren't trendy... by geekgirlandrea · · Score: 1

      I'd give anything for mod points right now. :)

    3. Re:Sorry, C variants aren't trendy... by Trepidity · · Score: 2, Interesting

      C++ has a lot of properties, but "simple" is hardly one of them. It's got so much stuff munged into it that the spec contains literally hundreds of pages special-casing bad interactions between features, and it takes a gigantic effort just to determine the type of an expression. Parsing C++ is actually not only not context-free, but undecidable, in general. It takes a heroic effort to determine whether A f(B,C); is a function declaration, or a call to a constructor. Static resolution rules are horrifically complex. The interaction of templates with everything else in the language is riddled with pitfalls. Etc.

    4. Re:Sorry, C variants aren't trendy... by JustNiz · · Score: 3, Funny

      >> It's got so much stuff munged into it that the spec contains literally hundreds of pages special-casing bad interactions between features, and it takes a gigantic effort just to determine the type of an expression.

      Yeah I'm so glad Java came along... oh wait...

    5. Re:Sorry, C variants aren't trendy... by psYchotic87 · · Score: 1

      An onomatopeia comes to mind: whooooosh!

    6. Re:Sorry, C variants aren't trendy... by rubycodez · · Score: 1

      what are you whining about, you'll see all those layers when when the compiler vomits six screenfuls of an error line. Just put a Bad Thing in the argument for your so-called unresolvable declaration. lazy git.

    7. Re:Sorry, C variants aren't trendy... by Sun · · Score: 1

      Java is a language who's main design criteria was "C++ is used for horrible things, so lets make them impossible". I really don't appreciate a language that does not trust the programmer (me) so much. As you can see, I'm very far from being a Java fan.

      Having said that, you have to hand it one thing - it is much simpler than C++. Much much simpler.

      Granted, the language being simpler often means that you have to jump through hoops to do what you want (who else misses C, which was both simple and trusted the programmer?) This does not change the core assertion - Java is much simpler than C++.

      Shachar

    8. Re:Sorry, C variants aren't trendy... by cerberusss · · Score: 2, Interesting

      C++ has a lot of properties, but "simple" is hardly one of them.

      We use Qt at my job for creating servers, daemons, interacting with hardware as well as doing GUI stuff. You don't really need to use the fancy C++ stuff, it's OK to just use the Qt classes and be done with it. Our code almost looks like Java, so simple.

      --
      8 of 13 people found this answer helpful. Did you?
    9. Re:Sorry, C variants aren't trendy... by Anonymous Coward · · Score: 0

      C++ has a nice web/ajax toolkit which is cross platform and also focuses on embedded devices. So if ajax type web interface is acceptable, then WT will run cross platform and on embedded devices. See http://www.webtoolkit.eu/wt

    10. Re:Sorry, C variants aren't trendy... by mabinogi · · Score: 1

      who else misses C, which was both simple and trusted the programmer?

      I don't miss it at all - I use it, every single day.
      It's not some dead forgotten language, you know. If you want to use it, use it.

      However, it's not that it trusts the programmer. It just doesn't care.

      --
      Advanced users are users too!
    11. Re:Sorry, C variants aren't trendy... by dgriff · · Score: 2, Funny

      C++? Too simple.

      That's not a statement you see very often.

    12. Re:Sorry, C variants aren't trendy... by Sun · · Score: 1

      However, it's not that it trusts the programmer. It just doesn't care.

      It amounts to the same thing.

      Don't get me wrong. I use it quite frequently too, but mostly where I have no choice (kernel, embedded). When I do, I prefer the shortcuts offered by C++.

      When I have to choose between C++'s overly complex syntax (but which I have already learned) and Java's distrust of the programmer, I choose C++. I do wish it had a better (simpler) syntax, though.

      shachar

    13. Re:Sorry, C variants aren't trendy... by Anonymous Coward · · Score: 0

      That's so last fortnight.

      All the cool kids are doing iPhone apps, dontchaknow.

    14. Re:Sorry, C variants aren't trendy... by Anonymous Coward · · Score: 0

      for me, C++ is right out.
      it's just too complicated and messy, and not worth the time it would take understanding it properly.

      For me, the options are Smalltalk, Java then C.

  31. Qt, Wx, pain by jipn4 · · Score: 0

    Qt and Wx are both open-source cross-platform libraries. However, doing anything cross-platform in C++ is a pain. You're probably better off using Python, Mono, or Java.

    1. Re:Qt, Wx, pain by bcmm · · Score: 1

      Did you just suggest emulating embedded hardware using python?

      --
      # cat /dev/mem | strings | grep -i llama
      Damn, my RAM is full of llamas.
    2. Re:Qt, Wx, pain by jipn4 · · Score: 1

      "Embedded hardware" can mean anything--Python may be fast enough. And if it isn't, you can still write an emulation library in C and everything else (I/O, parsing, user interface) in Python.

  32. Yu left out one #ifdef by tomhudson · · Score: 2, Insightful

    #ifdef __BSD__

    BSD and linux are different in some aspects when it comes to sockets. Made it a real PITA to code on linux, runs perfectly, then won't compile on BSD without a few more includes and some extra code.

    1. Re:Yu left out one #ifdef by alexott · · Score: 1

      boost::asio hides many low level details of networking, and provide pretty good high level interface to networking on almost all platforms... P.S. forgot about database and XML - for database you can use soci (from soci.sf.net), and for XML - arabica XML libraries, that supports different XML libraries - expat, libxml2, xerces, etc.

  33. Re:C++ is so old school... by zebrilo · · Score: 1

    yeah, Qt is made for C++ (despite there are plugins for Java and Python)

  34. Just use JAVA by Anonymous Coward · · Score: 0

    and get off my damn lawn!

    QQ I need cross platform development but I'm stubborn and have to use C++.
    Well you just need a combination of 80 different libraries and ass loads of useless header files and layers of abstraction.

    OR OR OR you can just use JAVA and have a tested working product out faster.

    1. Re:Just use JAVA by Anonymous Coward · · Score: 1, Funny

      Got yer polarity wrong. He's the oldster, you are the whippersnapper. You should be saying, "I'll get off YOUR lawn". Otherwise, your advice is sound.

  35. try boost... by alexott · · Score: 1

    boost::asio for networking + events, boost::treads for threading, and boost::interprocess for shared memory & other stuff...

  36. Re:C++ is so old school... by cbhacking · · Score: 3, Informative

    It's mostly because they aren't answering the OP's question, and aren't contributing any useful information to the discussion. Compare the posts above with the following:

    From what I've heard, one of the best cross-platform libraries for C++ is QT, (originally developed by Trolltech, now by Nokia). It's available either open source (LGPL) or commercially, and while best known for its UI toolkit also provides an extensive library of other functions. Wikipedia has a long list of things it has been used for, and other information.

    On the other hand, if you're not too wedded to C++ specifically, Java, C#, or Python might be good alternatives. Syntax-wise, C# and Java are extremely similar to C++, and all three have extensive libraries (built in) that provide the functionality you're looking for. They're also cross-platform (with C# you'd need to stick with stuff Mono can do, but that's still pretty extensive) and you don't even need to re-compile. Speed-wise, both Java and C# are nearly as fast as native code for most applications today, as are certain Python run-time environments. If you need explicit memory management for something, you can even do that with C# (although at that point it may be better to stick with C++).

    --
    There's no place I could be, since I've found Serenity...
  37. Just use POSIX by Anonymous Coward · · Score: 2, Insightful

    That handles all the things you mentioned, and you can compile pretty much all the same code natively on Linux or using Cygwin on Windows without having to bother with #ifdeffery at all.

  38. Boost and sqlite by rudedog · · Score: 3, Interesting

    For most cross-platform stuff, boost will do what you need. boost::thread will handle all of your threading needs.

    boost::filesystem for manipulating pathnames; boost::datetime for date and time operations; boost::format for typesafe printf style I/O.

    It also has boost::asio for sockets and boost::interprocess for IPC. I know nothing about them, but to judge from the quality of the rest of the boost library, they are probably very good.

    For database, use Sqlite. It's a solid relational database stored in a single file, and you can even access the database from the command line for ad-hoc queries/debugging/whatever.

  39. Apache Portable Runtime by Jester99 · · Score: 3, Informative

    You say that you're writing a lot of "C-like" embedded C++. Are you doing fully OOP style coding and using 'new' and 'delete'? Or are you mostly taking advantage of conveniences like namespaces, scoped variable declarations, etc?

    If your code is really more C-ish, you could take a look at the Apache Portable Runtime (http://apr.apache.org/). The APR is the library that Apache httpd is based on; they cover most system-level utilities (sockets, files, etc) you could need in a portable way. The APR is more 'C-like' in that a file descriptor is an opaque handle which you pass in to functions like apr_file_puts(), etc., rather than doing the C++ thing of file->puts()..

    But if you're ok with the syntax, it's Apache licensed (corporation friendly), well tested (httpd is pretty ubiquitous after all) and actively maintained.

  40. Re:C++ is so old school... by Anonymous Coward · · Score: 0

    Not sure how I managed to break the link so badly, sorry.

    http://mono-project.org/

    Time to go eat something.

  41. Re:C++ is so old school... by Profane+MuthaFucka · · Score: 5, Informative

    Yes, QT is really excellent, but it's worth it to look at Boost as well.

    Want a database? Why use Berkeley when there's SQLite?

    Portable sockets? QT and Boost both have them.

    Portable file ops? QT and Boost both have them.

    Data structures? QT has a bunch, but STL is what you should learn.

    Windowing lib? QT works on both Windows and Linux. You may be tempted to use WXWidgets, but don't. Despite the fan boyz, you'll find that library to be buggy as shit, and impossible to debug. Sorry, that'll probably get me marked as a troll, but it's true.

    And QT on Windows comes WITH the MinGW compiler for Windows package. You don't need to use any other tool than gcc on Linux, Mac, or Windows.

    --
    Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  42. SQLite for database by PizzaFace · · Score: 2, Interesting

    SQLite dominates discussions of embedded databases these days, but Berkeley DB still has fans who don't need SQL. There are a lot of comparisons on the web.

    1. Re:SQLite for database by Kjella · · Score: 1

      Just don't mention SQLite and threading in the same sentence. Or even concurrently running multiple queries in the same thread, like doing more queries while looping through a result set can cause hangs. It's great for what it does, but if it's anything more than a settings/profiles/log database, get a real one.

      --
      Live today, because you never know what tomorrow brings
  43. C++ Sockets Library (alhem.net) by Anonymous Coward · · Score: 0

    Check out C++ Sockets Library. Does Sockets and Threads.

    http://www.alhem.net/Sockets

  44. MONO by Vahokif · · Score: 1

    *ducks*

  45. Simple Direct Media Library (SDL) by Anonymous Coward · · Score: 0

    If you are looking to do a gui like project, SDL does windowing, input, imaging, audio, threading, all in its own little abstraction. It works on Windows, Linux, and Mac all the same.

  46. Heh, ACE is for old foggies by solid_liq · · Score: 2, Insightful

    Duh, Qt!

  47. Microsoft POSIX Subsystem by Anonymous Coward · · Score: 0

    I have no experience with it, but could this be easily achieved with normal POSIX on Linux and Microsoft's POSIX subsystem (separate download AFAIK) on Windows?

    1. Re:Microsoft POSIX Subsystem by alexmin · · Score: 2, Informative

      The sole reason for POSIX subsystem in WIndows was to satisfy formal criteria in some US government specs. No one is using it to actually _code_, AFAIK.

  48. dlib c++ by Anonymous Coward · · Score: 0

    http://dclib.sourceforge.net/, I like it a lot and it has nearly everything what you asked for. In a cross-platform way. I use it on windows, linux and Mac OSX.

    And even more, it has a very helpful admin who keeps the code clean and well documented.

  49. wxWidgets by Anonymous Coward · · Score: 0

    Really, no mention of wxWidgets yet? Personally it's what I use for most any old project. Its API is similar to Java's, and it has been LGPL'd much longer than QT, which is why I started using it in lieu of QT. It also has bindings for Python and a half-dozen other languages.

    1. Re:wxWidgets by quench · · Score: 1

      hey, I still remember the wxCanvas stuff. this is really oldschool, apart from the fact that I'am GUI-less.
      thanks anyhow, wx was cool last time I used it! (1994?)

    2. Re:wxWidgets by Anonymous Coward · · Score: 0

      WxWidgets is buggy. We used it in my company for some image manipulation stuff, and found quite a few things (TIFF support) that were not working as expected. When we contacted one of the maintainers they told us that he wasn't interested or didn't have the time to fix that issue.

      Since Qt became LGPL, there is little or no reason to use wx.

  50. UGH by Anonymous Coward · · Score: 1, Informative

    If you've been write multi-platform code using the preprocessor, you don't know what the hell you are doing. Don't blame the tools, learn how it's support to be done. Hint: define a proper build system that doesn't require any preprocessing.

  51. Warpdesign by Anonymous Coward · · Score: 0

    I would suggest SDL (SDL_Net,...)

    I'm not sure it covers Threads, but it covers Net for sure.

  52. Your project is screaming for boost. by Anonymous Coward · · Score: 0

    Your project is screaming for Boost.

    www.boost.org/doc/libs
    1) Portable networking via boost::asio
    2) Boost Filesystem
    3) Boost Interprocess
    4) Boost Thread

    Much of what is in the new C++ 0x10 standard comes directly from boost.
    If you use boost threads than you will be ready for C++ standard threads and etc.
    Boost also has zero licensing restrictions.

    It also plays nicely with python, another fine language.

    Best of all. It's not java!

    We use it extensively in a realtime medical device that includes several single board computers using either Linux or VxWorks.
    Yes, with some minor adjustments, most of the libs will compile on newer versions of the VxWorks toolchain.

  53. Another couple of options by EvilIdler · · Score: 2, Interesting

    There's always wxWidgets, which you can compile into your program if you feel like it. Quite liberal.
    It's not a mere library, but a full framework, like Qt. I find the wx runtime to be smaller than an equivalent Qt program most of the time, and the Mac version of Qt's dylib bundler sometimes makes some stupid decisions which bloat the app by 50MB. wxWidgets (statically linked) gives me a 1.7MB executable for a Hello World-ish program.

  54. Your App Will Suck Anyway: So Use Java by RonBurk · · Score: 2, Funny

    The Java repliers are right on the mark. Trying to use app-independent portability layers ensures apps of any complexity will suck. By "suck", I mean "compromised at every turn by lowest-common denominator design decisions". Your app will end up using threads on an O/S designed to make multi-processing beautiful (Linux), or end up using multiple processes on an O/S designed to make multi-threading beautiful (Windows). It'll be clueless about the nifty GUI features that exist on a Mac but not Windows, and vice versa. Knowing up front that your app is going to suck allows you to, in all good conscience, choose a language that highly adapted for creating apps that suck in this manner. When I fire up a Java app on Windows (and I ALWAYS know it's a Java app the minute it finally manages to lumber onto the screen), I know I'm going to get the same sucky behavior if I fire that app up on a totally different platform (well, assuming I can manage to figure out whatever obscure infinite-megabyte downloads are needed to get the right "runtime engine" for the given app). Really, the only way you can make your app suck even more and be even more portable is to just go ahead and make it a web "service". That has the added advantage that nobody really expects anything but poor performance and clunky UI design from the get-go. But if for some reason you can't have your app suck as bad as a web service, then Java is definitely the next-suckiest way to achieve that portability that your end users don't give a crap about, but you hope will make your life easier.

    1. Re:Your App Will Suck Anyway: So Use Java by Anonymous Coward · · Score: 0

      Linux handles threads just fine (and better than windows).

  55. Java, Perl, and WxWidgets... by taoboy · · Score: 3, Insightful

    ...are ones with which I have the most experience. WxWidgets IMHO is the best 'close-to-the-metal' API, with the most available constructs to allow me to implement in C/C++ the Perl prototypes I develop. But most recently I've been noodling with Java to develop a high-availability platform, and I regularly run multiple jvms in Windows command shells to build stuff out, and then take the classes unchanged to a ttylinux-SunJRE-based cluster I run with VirtualBox.

    I'm not a Java advocate by any means, but you can't ignore the portability...

  56. whoosh? by reiisi · · Score: 1

    GP was being sarcastic?

    And maybe a little (more than a little?) critical of AJAX, et. al.?

    Maybe?

    --
    Computer memory is just fancy paper, CPUs just fancy pens with fancy erasers; the 'net is just a fancy backyard fence.
  57. JUCE by Anonymous Coward · · Score: 0

    Have a look at JUCE: http://www.rawmaterialsoftware.com/juce/

  58. SQLite by melstav · · Score: 1

    You beat me to the suggestion.

    SQLite is a very powerful SQL database engine that is highly powerful and comes in a single < 500K library. No server needed.

    Interfaces to it exist for most modern languages.

    Documentation for the C/C++ API is here

    A more C++ friendly wrapper for SQLite is on CodeProject

  59. mono *ducks*? by reiisi · · Score: 1

    Is that the name of some kind of portable library?

    --
    Computer memory is just fancy paper, CPUs just fancy pens with fancy erasers; the 'net is just a fancy backyard fence.
  60. Go with BloCxx and SQLite. by Anonymous Coward · · Score: 0

    Go with BloCxx and SQLite.
    http://blocxx.sf.net/

  61. Boost, Qt by Anonymous Coward · · Score: 0

    C++ Boost is now the 'defacto standard C++ library' as far as I am concerned.
    Qt is the default UI and possibly Database access library for C++

    They do work together. You use Boost for everything, you can, if it is not there you use
    Qt, and if it is not in Qt you will have to find it open source.

    The only 'cross-dependency' you need to know is that for Boost if you need to use boost:::signals,
    use the signals2.
    Also, use boost::shared_ptr as it is now a standard 'reference counted garbage collector' for C++
    (it is also in C++ standard tr1).

    For the build environment you use CMake (it generates automatically project files
    for Visual Studio, Qt Designer, CodeBlocks, standard make files, etc)

    and as far as distributed communications (that is passing classes as 'messages')
    there is no 'standard' unfortunately.
    But OmniORB is exceptional (and interoperates with built in Java ORB if you need to).

    C++ is an exceptionally powerfull and expressive programming language, that allows
    to express Algorithms in separate libraries without tying them to a data-structure in a type-safe
    manner (meaning that if a developer initializes the library algorithm incorrectly he will get a compile-time
    error).

    C++ however is missing one key language feature that makes it less than desireable if you MUST
    serialize your in-memory data between your program invocation (which is why it is not used widely
    for stateless session management in web development).
    That key feature is 'Reflection' (or also called Introspection) -- without it it is very time consuming to serialize your in memory data into a file or database.

  62. Try LibNUI + SQLite by MeeLoo · · Score: 1

    (disclaimer: I'm the author of this lib). LibNUI supports iPhone, Win32, Win64, MacOSX and Linux. It offers complete OS abstraction for Threads, Windowing, Unicode Strings, OpenGL / GLES / Direct3D GUIs and many widgets. You can use it in any GPL application or buy a commercial license. Check it out: http://libnui.net/

  63. Simple by Anonymous Coward · · Score: 0

    1. Implement C++ in Python
    2. Use Python libraries for whatever platform independant stuff you need
    3. ???
    4. Profit!

  64. Poco is your answer by HedgeBoar · · Score: 1, Informative

    Boost is a good point to start and a good academic tool for the purists. ACE is trying to be too much for too many platforms. For real world use I ended up with Poco http://pocoproject.org/, very good performance, works flawless on Win/Linux platforms (base on my experience) and has an easy to use interface.

  65. open frameworks by Anonymous Coward · · Score: 0

    It's more for creative purposes. Does anyone else use this?

    http://www.openframeworks.cc/

  66. dito.

    --
    -><- no .sig is good sig.
  67. The OS-independence you want.. by slashmais · · Score: 1

    There is a very stable C++ IDE in Ultimate++.

    Quoting from the site:
    "U++ is a C++ cross-platform rapid application development framework focused on programmers productivity. It includes a set of libraries (GUI, SQL, etc..), and an integrated development environment.
    ...
    TheIDE can work with GCC, MinGW and Visual C++ 9.0 as contained in free Windows Vista SDK and contains a full featured debugger. TheIDE can also be used to develop non-U++ applications."

    --
    time time everywhere and not a second to spare
  68. APR and NSPR by Anonymous Coward · · Score: 0

    Apache Portable Runtime
    http://apr.apache.org/

    NSPR (Netscape Portable Runtime)
    http://www.mozilla.org/projects/nspr/

  69. two great portable runtime libraries by tlacuache · · Score: 1
  70. what does a database have to do with flash? by Dahamma · · Score: 1

    And a rock solid but simple embedded database to emulate flash memory.

    This part I don't understand... flash is a hardware solution to persistant storage. An embedded database is a software solution to structured storage of data. The two are completely orthogonal.

    Ignoring the flash part, I have used sqlite on several embedded projects (set top boxes) and it has done the job. Depends on your requirements though - is the priority speed, space, ease of use/API, etc?

  71. Try Freepascal by Anonymous Coward · · Score: 0

    You must try Freepascal/Lazarus, http://www.freepascal.org , http://www.lazarus.freepascal.org
    It is not C, but it is a well designed object oriented language/compiler. Also, you can use sqlite, or xml based database.

  72. Use Modula 3 instead of any variety of C. by hendrikboom · · Score: 1

    How about a platform-independent programming language complete with systems programming features, garbage collection, object-inheritance, type-safety and a way to bypass it when necessary? Have a look at Modula 3 and its libraries: http://en.wikipedia.org/wiki/Modula-3

  73. ACE and Boost Rock by Anonymous Coward · · Score: 0

    I have used ACE for a number of years. It contains a lot of design patterns that makes coding network based applications that much easier. I use ACE in conjunction with Boost; they complement each other fairly well. For example, I prefer to use ACE's threading constructs, but use Boost's shared_ptrs. We have also used sqlite a bit; it is a great, fast, embedded database that has a very small footprint. I haven't used Qt much, it has just recently become free for use for commercial apps; the projects I were on were cheap... I will have to say though, ACE's documentation is pretty terrible. I usually generate Doxygen documentation with linkable source code to see what ACE is doing under the covers.

  74. Has any one here every written an emmulator. by strangeattraction · · Score: 2, Funny

    Obviously there are not a lot experienced embed heads reading slash. Java:( If you don't like ifdef this or that try Java. Instead of ifdef, Java programmers us xml in what I call program by configuration file. It adds an entirely new dimension to programming that most skilled programmers would never have thought of. It is even more delightful when they use multiple overrides on their configurations files and you have to hunt through multiple files to to see how things are configured. Not only that, they can actually change the way code executes with configuration files. So not only do you have to look at code to see execution paths, you have to dig through multiple configuration files. It is truly the strangest methodology I have ever encountered. Stick with a C or C++ library. QT works well. For key value searchers Berkeley has no peer but SQLite works ell if you are into SQL.

  75. OS wrappers by larytet · · Score: 1

    wxWidgets emLib http://larytet.sourceforge.net/ are two options I used. emLib is available in LGPL - contact the author.

  76. Qt by jkajala · · Score: 1

    If you need a graphical user interface in your application go for Qt. Seriously, you won't regret it. I'm also using several other open source libs like Boost, but those won't help a bit to get your cross-platform GUI running. Qt, in contrast, handles that great, and has IPC, SQLite integration and thread abstractions a bonus. Besides, if you are starting as a "fresh" user , you will have benefit that once you have learned a bit Qt you will be comfortable with the other classes in the library as well. In contrast, if you decide to go for different lib for each purpose, you will have a lot more to learn (and to integrate).

  77. Highly recommend Poco over ACE by Samarian+Hillbilly · · Score: 1

    I've used ACE a lot, 10 years ago, even then the code looked like it'd been hacked on by 4 generations of under-grads (which it had). Basic stuff works good, but there are some lurking race conditions in shared memory pools that you don't want to meet. I recommend Poco, industrial, easy-to-use etc.
    http://pocoproject.org/

    I wouldn't consider boost, yet, they're just starting to put in a full suite of cross-platform stuff and they're still missing some important pieces.

  78. poco and boost by Anonymous Coward · · Score: 0

    See http://pocoproject.org/. It's built on top of boost, and is in modern c++ style. That includes
    database bindings for sqlite and others.

  79. Time (sort of) still stands by Chuu · · Score: 1

    Boost is an absolutely incredible library, and any C++ programmer who doesn't use it is probably missing out. That being said, if you know ACE (i.e. have made it past the pretty steep learning curve) then ACE gives you more options. Boost's thread library is pretty great, but they simply don't have as fine control over primitives. There are also many things that you can do in ACE that you simply can't do in boost easily -- such as non-static pooled allocators.

    Unless I am completely missing something, there is also no equivalent to the TAO in Boost.

    I work on performance critical C++ code (yes, there really is such a thing) and we pretty much use ACE for anything involving IPC, sockets, or Threading -- and boost for everything else. That being said, the boost ASIO, thread, IPC, and Intrusive libraries are so easy to use compared to their ACE counterparts that unless performance is critical or boost simply isn't enough -- there isn't much use in learning ACE from scratch.

    1. Re:Time (sort of) still stands by Yosho · · Score: 1

      Unless I am completely missing something, there is also no equivalent to the TAO in Boost.

      Thank goodness. I've never really understood what the point was to having an ORB bundled with your C++ middleware library. Compared with TAO, I've found standalone ORBs like omniORB or ORBexpress to be equivalent or better in performance and much smaller in size.

      --
      Karma: Terrifying (mostly affected by atrocities you've committed)
    2. Re:Time (sort of) still stands by old+cob · · Score: 1

      TAO (The ACE ORB) is not bundled with ACE. ACE is bundled with TAO as it provides the platform abstraction layer. If you want a nice multi language solution, CORBA with its many open source implementations can be the answer. Many people need RT CORBA and having an ORB built on ACE, that can use many RTOSs, is a big deal. Note ACE is also bundled with OpenDDS to offer an open source RT pub sub system that supports C++ and Java. Again an RT pub sub that does not run on RTOS would be a waste. ACE plugs that gap. So ACE has a lot of complimentary products that can give a big help when building large weapons systems, financial systems such as market data and trading, and telecom call switching.

  80. Poco + Boost by Anonymous Coward · · Score: 0

    Well, if you need a database abstraction layer - Poco is pretty good for embedded platforms (http://pocoproject.org/). It'll allow you to swap between odbc and sqlite connections out of the box - it's also pretty easy to extend. Poco is heavily targeted towards writing generic (non-ui) applications for Windows/Unix. It's also got abstractions for Filesystems, Network, Threading, and Application factories. It's not perfect, though -- we had some issues with Poco's containers not properly handling const template parameters, so eventually pulled in boost. We've found everything is pretty harmonious if we use boost when we can and Poco for the places where boost is lacking (ie DB abstractions, etc).

  81. Try POCO. I've found it to be pretty useful.

  82. PTypes by dmesg0 · · Score: 1
    If you are looking for something small, clean and very easy to use - PTypes (http://www.melikyan.com/ptypes/doc/index.html) may do the trick. It has classes for threads, sockets, i/o, shared libraries etc. It's also very easy to extend if some functionality is missing.

    And it has zlib license, so you can do anything with it.

    Disclaimer: I have nothing to do with the library development, just a user.

  83. Cygwin by Madsy · · Score: 1

    Java, or link to the Cygwin library. The latter gives you a kind of POSIX API wrapper for your windows applications. So you can use POSIX threads and IPC stuff if you want. I'm not sure how efficient that is though, or how stable the general Cygwin API is.

  84. Roll your own by Anonymous Coward · · Score: 0

    Yes, that's it. Roll your own.

    Sockets are pretty much the same (salve the SOCKET type is in fact an int in POSIX land). Threads and IPC are not that different, either. Stick to what you actually need, and KISS (keep it simple). All in all, a week of work (I know because I have done it).

    By the way, just avoid littering your code with #ifdef. Put one in the header file and define common types, then try to use exactly the same code everywhere. Only put #ifdefs in the code if there's no other way.

    As a side effect, you will become a kick-ass threads and sockets programmer.

  85. POCO by Anonymous Coward · · Score: 0

    If you find boost or Qt too heavy, you might want to check POCO libraries

  86. Qt + SQLite by Per+Wigren · · Score: 1

    Qt and SQLite. Seriously. LGPL and kick-ass! Also, Qt can be compiled to have SQLite completely built-in. No extra libs/dlls needed. It handles networking, threading, IPC, SQL and much more. No need for platform-specific ifdefs.

    --
    My other account has a 3-digit UID.
  87. Perhaps QT has what you need by Anonymous Coward · · Score: 0

    The database you are after is surely SQLite -check out (sqlite.org).
    As far as portable C++, you probably want to check out QT. Not sure about IPC, but QT these days comes with much more than GUI, includes threading, networking, SQLite and plenty more.
    QT is simple, intuitive, portable and available under GPL.

  88. C++0x by Engeekneer · · Score: 1

    For really early adopters, C++0x includes built in threading support. You'll still have to use libs for sockets though.

  89. He asked for a C++ toolkit by OeLeWaPpErKe · · Score: 1

    The obvious answer would be QT, imho.

  90. openKode by Anonymous Coward · · Score: 0

    openKode (http://www.khronos.org/openkode/) from khronos group
    the core component is the OS abstraction
    my company works on many different platform and we are pushing each vendor to write this component. for those who don't we do it ourselves.

  91. My experience by Anonymous Coward · · Score: 0

    Qt allows my applications (database driven for example) to work in Linux, Windows and Mac OS. The translation system is superb and easy to use. I can not talk about, for example, OpenGL from Qt because I've not used it.

  92. SharkEngine by Anonymous Coward · · Score: 0

    Hi, I have tried different socket libraries for Windows and Linux applications. SharkEngine is a free C++ library for network, file and multi threading support. There are also higher level protocol classes so you don't need to reinvent HTTP and SMTP for example. Otherwise QT and Boost are obviously good choices, then there is "Alhem's C++ Sockets Library". I never used ACE, the documentation is confusing and I think John Snader warns in his TCP/IP Programming book about it. Here is a list with contenders:

    * SharkEngine http://www.pichat.net/documentation/pichat_sdk_sharkengine
    * QT http://doc.trolltech.com/2.3/network.html
    * Boost http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio.html
    * Alhem http://www.alhem.net/Sockets/

    When it comes to small databases I know only SQLite, which is programmed in C and more powerfull than Berkeley-DB. See http://www.sqlite.org./

  93. POCO project by jbb999 · · Score: 2, Informative

    Definatly take a look at poco project http://pocoproject.org/ It seems to covera lot of what you want

  94. Re:C++ is so old school... by Hal_Porter · · Score: 2, Funny

    I think modding people Troll is the /. equivalent of smacking dogs on the nose with a rolled up newspaper when they defecate in the apartment. I.e. it's just a way to stop them doing it again. Clearly no one wants to read "Why not use Java?!" in these sorts of discussions. Now you can't explain to a dog why indoor defecation is bad, just like you can't explain to Java programmers why Java is just a bad idea. Still shit in the apartment and posts advocating Java is not something which you need to tolerate.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  95. Boost by Anonymous Coward · · Score: 0

    Always use boost if they have a library that does what you want. Not only because it does what you want and is portable but also because boost is well maintained, updated frequently, the code quality is top notch and the boost libraries share a common approach to doing things which makes it easier to learn (you will probably learn a thing or two about using modern C++ yourself if you use them). In other words, boost rocks. There is also a high probability that it will eventually be incorporated in the C++ standard library.

  96. Glib and Gtk++ by pkphilip · · Score: 1

    Glib + Gtk++ is pretty decent. You also have Gnome Db for database access. A number of people have suggested QT and also WxWidgets. Both are pretty good.

  97. gtkmm by emanem · · Score: 1

    the C++ GTK+ interface is great...deploying GUIs is really easy, swing/awt like...
    Plus you have very good STL support and a lot threading/files/io cross platform support.
    And it's proper C++!

    Cheers,

  98. Re:C++ is so old school... by Anonymous Coward · · Score: 0

    I've been using wxWidgets for 4 or 5 years now for our company's commercial product and find it quite stable, and I use almost every aspect of it. Also, it works just fine with GCC on my Linux box and my Snow Leopard machine.

    Not to be too critical, but do window libraries really have "fan boyz" :) If so, then I guess I am one of them.

  99. Words of ignorance. by Anonymous Coward · · Score: 0

    "" Now, I am about to start a project emulating embedded hardware on Windows ""

    since you're already in hell, you can as well go with perl.

    ---
    flame me all you want, this guy is doomed already

  100. +1 on Boost and Qt by krilli · · Score: 1

    So yes. Here's just a quick +1 on Boost and Qt.

    --
    Jag pratar lite svenska.
  101. WT Toolkit by croftj · · Score: 1

    If you want what looks like a promissing web interface you might try http://www.webtoolkit.eu/wt. Life's beautiful when you can do web stuff in just one language

    --
    -- Many men would appreciate a woman's mind more if they could fondle it
  102. Mono by Anonymous Coward · · Score: 0

    Why use mono on windows when you can just run it against M$ .NET Framework?

  103. New and trendy by tuomoks · · Score: 1

    Or maybe not, Qt, Boost seem good choices based on your experience, but it really depends. The best hw emulators (and simulators) I have seen / done / supported were written in LISP, yes, not new nor trendy.

    And there is of course Erlang, it has all in language, is natively threaded even between nodes if desired, has very good database(s) natively, and so on - but not new nor trendy. Much less coding, configuration, etc effort than in most languages but maybe needs some time to get used.

  104. Some starting points by Anonymous Coward · · Score: 0

    Try BerkeleyDB with libstldb4 (a bit incomplete perhaps (binary support isn't great yet), but pretty good) and ASIO (Boost or non-Boost version). There's a lot more to writing platform-independent programs than any library or language is going to do for you, though.

  105. Re:C++ is so old school... by Profane+MuthaFucka · · Score: 1

    I once killed a man right at his keyboard for claiming a segfault in the QT library. This is serious stuff.

    --
    Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  106. Commercial grade by scout007 · · Score: 1

    As an addition to the already mentioned, there is also a commercial grade that might be easier to use than Boost. SourcePro C++, you can check it out at http://www.roguewave.com/products/sourcepro/.

  107. Why platform independence? by jgrahn · · Score: 1

    You say you're "emulating embedded hardware on Windows". What will you use the platform independence for? If you don't need it right now but "maybe in the future", I suggest skipping it. Write for Windows, but make sure ask the compiler to accept ISO C++ only, and don't sprinkle Windows-specific crud (UWORD, __declspec and whatever they are called) in the parts of the code which *are* platform-independent.

    An unused portability layer only weakens your code.

    Personally, I couldn't care less for Windows, so I develop under Linux and target Unix in general (not actively, but I expect it to be easy to port to some other decent Unix if I have reason to in the future). It's great -- I can use select(2), fork(2) and treat file descriptors and sockets alike. And I can learn from good books (e.g. Stevens) and discuss it with people who have been using those interfaces since, well, forever. No portability layers have that much support.

    By the way, I don't see why you need a bloody *database* (even a nice one like BerkleyDB) to emulate flash memory. Can't you just mmap() a file?

  108. Try TnFOX by ned14 · · Score: 2, Informative

    I also come from an embedded background and I didn't find a C++ platform abstraction library to my liking (i.e. fun to use and giving the programmer maximum power and control), so I went off and wrote my own: http://www.nedprod.com/TnFOX/ (docs are at http://tnfox.sourceforge.net/TnFOX-svn/html/). You can build a noGUI version which leaves out all the GUI stuff which should provide what you want: it also has a type reflecting metaprogramming database adapter with a copy of SQLite3 thrown in for good measure, and it is very seriously fast and efficient unlike most GUI toolkits e.g. all the bottlenecks use assembler or intrinsics and there is ample stream computing support which uses metaprogramming to assemble vector instructions. One major difference from libraries such as ACE is that I deliberately made TnFOX as fun to program in as possible - I have made zero attempt to make it academically "proper" or "pure".
    Hence it does come with an unusual programming paradigm - I make heavy use of C++ metaprogramming constructs and C++ exception handling and pervasive multithreading. And almost no one else uses it which I take it to mean that its learning curve simply isn't worth it for most people which is fair enough. In the end, if you ever want someone else to be able to work on your project then you need to use a well established toolkit which has a significant programmer pool attached to it. And ease of finding programmers is vastly more important than a "right" or "proper" or even "good" programming paradigm - as the designers of Plan 9, BeOS and NeXT found out.
    If your project is something recreational, do give TnFOX a look. If it's for something ever destined for outside your personal fun time, go with Qt or wxWindows or any big free portability library.
    HTH,
    Niall

  109. This is a FAQ by shutdown+-p+now · · Score: 1

    In general, you'll be better off asking such questions on StackOverflow - you'll get an answer within minutes without having to wait for it to be posted. In fact, you wouldn't even have to ask - this is one of those question that's asked so frequently that there are plenty answers on various aspects of it.

    The short answer is: if you need UI and/or are familiar with Java, use Qt. If you don't need UI or you really like idiomatic C++ (think STL), use Boost.

  110. randhir by Anonymous Coward · · Score: 0

    * ACE: Good for network heavy work. But you do not have to use the whole thing. Just go for the lower layers. i.e. ACE_OS is a static layer that provides a very thin wrapper around native calls. One step up, and you're working with Socket and Thread objects build on top of that, which is also great. However you might not want to get into the Reactor Proactor, Acceptor Connector pieces if you are building something small and lightweight, and you don't have a team to maintain it.

    * WxWindows: Decent for cross platform applications but careful about subtle behavior differences (e.g. recursive locks suddenly become non-recursive on the other platform. might be fixed by now though.). Though I havent seen it used in industrial strength server projects, as ACE is commonly used. From what I remember the cross platform GUI pieces are fast and clean though.

    * BerkelyDB: I dont know enough about what operations you need in your emulator to comment.

  111. MS Subsystem for Unix Applications (SUA) -- NO by Anonymous Coward · · Score: 0

    Stay away from it. On the surface, it looks quite attractive, and can do things that Cygwin can't (like 64-bit apps), but the reality is different. This is a piece of software that MS has bought from a third party a while ago, for reasons unknown, but doesn't want to spend resources on anymore. We've tried using it on a fairly large C/C++ project, and found quite a few bugs, some of them being rather bad. Trying to get those bugs fixed is a major pain, even with a support contract, and our attempts to escalate have been fruitless.

  112. Re: platform independent C++ by Anonymous Coward · · Score: 0

    Take a look at Poco (pocoproject.org).

  113. C++ on .Net? by GWBasic · · Score: 1

    Microsoft Visual Studio's C++ compiler has an option that lets you generate 100% CLR binaries that will run on Mac and Linux with mono. The limitation is that you can only use the .Net API.