LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Compiling a simple C++ program for Windows (https://www.linuxquestions.org/questions/programming-9/compiling-a-simple-c-program-for-windows-298096/)

Baix 03-05-2005 05:29 PM

Compiling a simple C++ program for Windows
 
Hey guys,
Just made a mm to inches converter with C++ and compiled it using g++ to produce a.out, how should i compile it so that i can run it on my windows machine because a.out means absolutly nothing to windows.

Thanks in advance!

acid_kewpie 03-05-2005 06:22 PM

you'd need to cross-compile it for windows, and i don't even know if that's really possible... cross-sompiling for other unix platforms, e.g. bsd or solaris isn't too tricky, but win32, i can't see. maybe mingw32 running under windows would be a better option.

jschiwal 03-05-2005 07:17 PM

If your program is a console application using standard c functions, then you should be able to compile and run it in windows without altering the program first. Another option is to install Cygwin on your windows machine and recompile the program in gcc there.

http://www.cygwin.com/

You might consider writing scripts instead of compiling a C program if you want an application to run in both windows and linux, using TCL, perl, python or others.

If you want to write cross-platform gui applications, you might consider Tcl/Tk or WxWidgets:
http://www.wxwindows.org/

I supplied a link for you if you are interested, however if you do a search, you may have it on your installation disk, and just need to install it.


All times are GMT -5. The time now is 01:59 PM.