Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Cross Platform c/c++

Options
  • 07-01-2012 6:25pm
    #1
    Registered Users Posts: 1,686 ✭✭✭


    Hi,

    I have been doing c/c++ for windows using Netbeans plug-in with cygwin and codeblocks with mingw.

    The problem now is that I want to make my applications compatible with Linux.
    How do I go about doing this?

    I am running ubuntu on VirtualBox


Comments

  • Registered Users Posts: 2,023 ✭✭✭Colonel Panic


    Here's a general list of suggestions...

    How complicated is the app? Do you use any Win32 calls? Do you link against any libraries that are Windows only?

    General rule for retrospectively porting code to another platform is set up a project or makefile. Add all the files, set up any preprocessor settings, try to get it to compile and stub out anything non cross platform until it compiles, then port whatever you stubbed out.


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Use cmake. Works with gcc on linux, and msbuild on windows. Is a modern way of dealing with makefiles etc.

    http://www.cmake.org
    http://en.wikipedia.org/wiki/CMake

    Also I find stuff like Jenkins very useful for cross-platform stuff. You could make a change for windows that breaks linux build for example, jenkins will show these problems quickly.


Advertisement