LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-05-2005, 05:29 PM   #1
Baix
Member
 
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, 06:22 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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, 07:17 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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

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


Reply



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 12:07 PM
compiling simple c/c++ program but no good freeindy Programming 3 02-12-2005 11:38 AM
what is a good simple *cough* windows-like dialer program? visxera Linux - Newbie 2 03-25-2004 02:15 AM
Compiling a simple C++ program kbeaver Programming 27 02-06-2004 08:02 PM
Compiling a simple Mesa/GLUT program Bojdom Linux - Software 2 02-02-2003 04:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:25 AM.

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