Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-05-2005, 06:29 PM   #1
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Rep: Reputation: 30
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!
Old 03-05-2005, 07:22 PM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971
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.
Old 03-05-2005, 08:17 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658
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.

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:

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.

Last edited by jschiwal; 03-05-2005 at 08:25 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems compiling a simple shell program yekrahs Programming 3 09-26-2005 01:07 PM
compiling simple c/c++ program but no good freeindy Programming 3 02-12-2005 12:38 PM
what is a good simple *cough* windows-like dialer program? visxera Linux - Newbie 2 03-25-2004 03:15 AM
Compiling a simple C++ program kbeaver Programming 27 02-06-2004 09:02 PM
Compiling a simple Mesa/GLUT program Bojdom Linux - Software 2 02-02-2003 05:19 PM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration