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?
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?
Wine perhaps?
Mainframe assembler programmer by trade. C coder when I can.
gcc allows for cross compilation. not sure how well it works but you can check the man pages for how to do it.
you can just run a linux envirounment on windows - for example using andLinux distro - you get fully functional linux install running inside "windows window"
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
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.
Cygwin, I think is the most easy to learn Unix environment for windows. It's probably the best solution.
Okay, very interested in this. That way I can run programs myself and not rely on the charity of others.
but andLinux is? Wouldn't that make andLinux better?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.
I'm actually thinking a dual boot. What is the defacto norm for Unix now-a-days?
Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week!
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?
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
the situation seems very complex here
I'm not sure it's that difficult. You just need to build gcc for cross-compilation, then build the binutils for cross-compilation. Once you have done that, you need to compile (or copy) the Linux C and C++ libraries.
I'm pretty certain gcc-mingw can be used to compile gcc and binutils to produce Linux code.
It is no more strange than using gcc to compile code for ARM or MIPS on a PC.
You may need to have to work a little bit with getting "./configure" to run on a Windows system, but other than that it's not that hard.
Of course, the next problem is testing the code - if you haven't got a Linux machine to test on, then you wouldn't know if your newly compiled code works or not.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Slax would be a viable alternative to building a cross tool chain. . . especially since Wall-mart has 8GB jumpdrives for $20. . . There are ways to install a full blown install with it.
$0.02