Is there a program/compiler to write C++ for linux on windows? [Archive] - C Board

PDA

View Full Version : Is there a program/compiler to write C++ for linux on windows?


6tr6tr
04-12-2008, 09:59 AM
I know that Linux has programs so you can use a Linux OS and compile C++ code for a windows environment. Is there such a thing in the reverse?

Dino
04-12-2008, 11:02 AM
Wine perhaps?

MikeyIckey
04-12-2008, 11:44 AM
gcc allows for cross compilation. not sure how well it works but you can check the man pages for how to do it.

vart
04-12-2008, 02:05 PM
you can just run a linux envirounment on windows - for example using andLinux distro - you get fully functional linux install running inside "windows window"

brewbuck
04-14-2008, 08:56 AM
I know that Linux has programs so you can use a Linux OS and compile C++ code for a windows environment. Is there such a thing in the reverse?

You would need a cross compiler and a cross toolchain. I've never tried this (built a cross-cc from Windows to Linux), but if I did, I would use Cygwin as a base on Windows, then install a cross-binutils for Linux ELF, then install a cross-gcc. Before installing the cross-gcc you will have to copy all the system header files and libraries from the Linux system to a location where cross gcc can find them. There is a cross compiler FAQ for gcc you will have to refer to.

EDIT: One thing I have done, it translated Windows .obj files to Linux ELF .o files, then done the linking step on Linux. This lets you do the sick thing of compiling Linux programs using Visual Studio. Provided there's nothing "weird" happening in your .obj files, I remember the process being smooth enough to be workable. Kind of pointless however.

rimig88
04-15-2008, 04:34 PM
Cygwin, I think is the most easy to learn Unix environment for windows. It's probably the best solution.

guesst
04-16-2008, 08:05 AM
Okay, very interested in this. That way I can run programs myself and not rely on the charity of others. (http://cboard.cprogramming.com/showthread.php?t=101766)
Cygwin is not a way to run native linux apps on Windows. You have to rebuild your application from source if you want it to run on Windows.
but andLinux is? Wouldn't that make andLinux better?

I'm actually thinking a dual boot. What is the defacto norm for Unix now-a-days?

6tr6tr
04-16-2008, 08:24 AM
Thanks for the replies. Since I have MinGW/GCC already I'll start looking into that. But I can also the benefit of having linux running in Windows to try it out quickly too. Any other suggestions?

matsp
04-16-2008, 08:28 AM
Any of the Virtulization products (Xen, VMWare and several others) will allow you to run multiple instances of OS's on the same machine at the same time [I believe "andLinux" uses some similar techniques to make Linux run on top of Windows - but I'm not sure].

--
Mats