Sign in to follow this  
slun

Cross Platform Compiler?

Recommended Posts

Hello. This is probably a really silly question, but I haven't managed to find a good answer online (Google). I learned to use DirectX 9 a little while back, and decided to switch all of my code over to OpenGL. During the time I was using DirectX, I was coding everything in Visual Studio 2005, then I switched over to 2008. I'm looking for a good compiler that can work on both Linux and Windows. I've managed to get my current OpenGL code base to compile under Linux, so I'm looking for something where I don't have to worry about Visual Studio solutions. I'm currently just copying all of the code files over to the Linux box and compiling them with g++. Just looking for a less tedious way to compile on both OS's... Thanks in advance.

Share this post


Link to post
Share on other sites
The MinGW project claims to port all of the build-utils of GNU (gcc, g++, make...) and they did it pretty good, so u just install MinGW and you get gcc/g++ for windows.
Also you can try the Cygwin its like bigger-MinGW, u can run almost everyting *nix via Cygwin, but MinGW will be enough.

Share this post


Link to post
Share on other sites
If your goal is just to not worry about Visual Studio solutions, then I think what you really want is a cross-platform build tool.

Two good ones are SCons and Cmake. For both tools, you just write one makefile that works across platforms.

Cmake works by generating a project file that's appropriate for your OS. On windows it generates a Visual Studio project file, on Mac it generates an Xcode project, and I don't know what it makes on Linux but it makes something.

SCons works by finding your compiler at build time. If you're on Windows, it will hunt down your VS compiler binary and use that, if you're on linux/mac it will find gcc.

I use SCons for everything and I'm pretty happy with it.

Share this post


Link to post
Share on other sites
Even better, Codeblocks can import visual studio projects :)

Just do your thing in visual studio ( assuming you like visual studio over codeblocks ), then import the solution to codeblocks and compile.


Or use monodevelop, it can even export visual studio projects.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this