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?"

10 of 310 comments (clear)

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

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

    1. 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!

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

    Nokia QT rocks...

    1. 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.

  3. 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...

  4. 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.

  5. 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.

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

    Duh, Qt!

  7. 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...

  8. 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.