Tuesday, July 14, 2009

C compiler for linux?

I have anjuta and I know how to use the g++ command on terminal but they only make linux executables. I want to know, is there any linux program that can make windows executables? I used WINE windows emulator and installed bloodshed Dev-C++ but I get a list of errors when trying to compile, most of them say 'Linker Error' in front of them. Please just tell me a Linux program that will compile C scripts into windows programs..! I am using Ubuntu operating system.

C compiler for linux?
There's no such thing.





Well, almost.





You're looking for a cross-compiler. GCC and perhaps some other suites do exist as cross-compilers, however those are very hard to come by and the effort of building one yourself is not worth it for most practical purposes.





The previous answer is misleading. MinGW mentioned above is NOT cross-compiler - it's a compiler that works on Windows and produces binaries for Windows.





If Linux is the only machine you have access to, install VMWare Server onto it (Free) and run Windows in it with any normal Windows compiler, like Microsoft Visual C++ 2008 Express (Free) or GCC or even that MinGW.





WINE will probably work too, but it's not as robust.


The linker errors you're getting most likely have to do with your program - work through them. If you get a lot of errors, the problems are likely in your program code - not in compiler - you need to port the code to Windows.
Reply:http://www.mingw.org/





@General Cucombre: Had you bothered to read for more than 5 seconds, you would know that MinGW runs on Linux.





http://packages.ubuntu.com/feisty/mingw3...


No comments:

Post a Comment