Advertisement

Linux Compiling from MSVC?

Started by March 13, 2001 10:26 PM
4 comments, last by gimp 23 years, 10 months ago
Just a curious thought... Is it possible to configure MSVC to compile a Linux version of my exe? ie, use gcc or something in a shell. If so whats the chance it can also make those pesky makefiles for me too? Many Thanks Chris
Chris Brodie
Look into configuring the "Custom Build" settings on each file you want to compile with GCC fromw within MSVC.
Advertisement
Ok, so it is possible. Anyone got some more information on the subject? Perhaps a tutorial link? I''d also expect that I''ll need a compiler that was setup for use on Win32....

Any suggestions?
Chris Brodie
Well ... not only do you need the compiler set up for win 32 ... which is EASY ... you can go get GCC from gcc.gnu.org ... but the problem is ... you have to configure it as a "cross-compiler" ... or at least kinda ... usually a cross compiler is used to generate output for a different "target platform" than the system you are running (called the "host platform") ... in your case ... you want the same x86 instruction output ... but you need to set the object format to one you can use in Linux ... not windows (I know coff and elf are formats but I don''t know what platforms use what targets) ... if you download the GCC source then build it ... the target can be configured in that process ... but I''ve never tried it (by default it detects your enviroment and uses the right target for that machine.

I would HIGHLY recommend that you get the GCC windows binaries first .. and get it set up to compile your !windows! version with that (from MSVC) ... and test it ... then go about building a different install set to target the linux format ... then you''ll now any errors you run into are GCC config related ... and you can get help from GCC / Linux gurus ...
Wise advice, thanks...
Chris Brodie
Hi,

If you are using a lot of functions from the MSVC stuff then it probably won''t compile. Also there shouldn''t be stuff like Window Class in the code coz the object code MSVC links to will be totally different than Linux environment. You might end up writing the whole code over again.

Also if you have used assembly, then well you better rewrite it.
Also I don''t think MSVC will be able compile for linux and I don''t think that support will ever come coz MS hates linux :-).

Hello from my world

This topic is closed to new replies.

Advertisement