|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ziff Davis Enterprise Virtual Tradeshows: Hot Topics, Cutting Edge Technology, Real-time Interaction with IT Professionals. Learn more at ziffdavisvts.com
|
|
#1
|
|||
|
|||
|
Question about Compilers
I have a different kind of question. I was wondering if there is a compiler that will compile C/C++ programs that run on Windows and Unix/Linux?
Thanks, Jonathan Donaghe |
|
#2
|
||||
|
||||
|
I have never used the following product so I can't tell you anything about it:
http://www.mainsoft.com/products/mainwin.html |
|
#3
|
||||
|
||||
|
The GNU compiler is available for both platforms. If you're asking whether you can compile a program on Windows and have it run on *nix, then no. The executable formats aren't compatible.*
* This isn't entirely true - you could get a cross compiler, but you'd still have to compile two different versions - one for Windows, one for *nix. You're better off just compiling on the intended platform. EDIT: See the above post.
__________________
Jon Sagara "Me fail English? That's unpossible!" |
|
#4
|
||||
|
||||
|
You can write a C/C++ program for both system types by the use of include directives to define which sections should be included in on windoze systems and *nix systems.
The link that jonsagara listed for the gnu compiler is what you are looking for, you can get it integrated also if you get the cygwin environment (plus some excellent unix commands). Also, as jon said, you can't compile it on one system and that executable run on the other, they are incompatable in that aspect. You have to compile the source code on the os type you wish to run it on. The other problem, especially if you are writting window style applications, they will not port over at all, unless you use something like the wxWindows library to build the program, which will port to either system, but you still have to compile it on the system you want to run it on. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Question about Compilers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|