LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-29-2003, 08:57 AM   #1
odious1
Member
 
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252

Rep: Reputation: 30
Can I compile a windows .exe?


I am taking a c++ where we are compiling our programs using visual c++. What I was wondering is there some way I can compile windows apps without the microsoft product? I installed cygwin on my pc thinking that would work and it may but there are no man pages unless I did something wrong. Or even better is there an app I can install on my RH machine that I can use.

This whole kernel/compiling/header thing is very confusing to me but I want to learn!

I appreciate any help
 
Old 08-29-2003, 09:14 AM   #2
deepsix
Member
 
Registered: Apr 2003
Distribution: ANY
Posts: 339

Rep: Reputation: 32
http://rooster.stanford.edu/~ben/linux/crosshowto.php <---check this out hope it helps or at least puts you in the right direction
 
Old 08-29-2003, 10:06 AM   #3
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
As long as you don't write programs in windows that need windows libraries, you can compile c++ on GNU with g++.
 
Old 08-29-2003, 10:18 AM   #4
odious1
Member
 
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252

Original Poster
Rep: Reputation: 30
I do not know if I am doing something wrong or not but I keep getting error messages when I tried g++ or 1386...gcc. They appear to be syntax errors but it compiled fine with the visual c++. Does this mean I am doing something wrong or do I need to try and fix the code for use with a differend compiler?
 
Old 08-29-2003, 10:20 AM   #5
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
You might be using libraries g++ doesn't have, can you post the source?
 
Old 08-29-2003, 10:46 AM   #6
odious1
Member
 
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252

Original Poster
Rep: Reputation: 30
Thanks for the help. Don't laugh at my litte program, I am just learning. But anyway this thing did fine when I compiled it withe microsoft visual c++.

Thanks

#include <iostream.h>



char target1;
int target2;
short int target3;
long int target4;
unsigned int target5;
float target6;
double target7;
long double target8;

void main(void)
{

cout << "\nBytes of storage used by a character: "
<< sizeof(target1);

cout << "\nBytes of storage used by an integer: "
<< sizeof(target2);

cout << "\nBytes of storage used by a short integer: "
<< sizeof(target3);

cout << "\nBytes of storage used by a long integer: "
<< sizeof(target4);

cout << "\nBytes of storage used by an unsigned integer: "
<< sizeof(target5);

cout << "\nBytes of storage used by a float: "
<< sizeof(target6);

cout << "\nBytes of storage used by a double: "
<< sizeof(target7);

cout << "\nBytes of storage used by a long double: "
<< sizeof(target8) << '\n';
}
 
Old 08-29-2003, 11:36 AM   #7
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
First: main() really needs to return an integer so change this line: void main(void) into int main()

Second: compiles fine on my computer, maybe it's time to check how you actually compile the source.

if it's called test.c, do this: g++ -o test test.c
and if it's still not working, post the error output.
 
  


Reply


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
unable to compile .exe files under KDevelop stealthgate Linux - Software 2 09-16-2005 05:34 PM
Linux binary to windows exe bolabala Linux - Newbie 10 02-11-2005 11:31 AM
Is it possible to compile a windows .exe program using g++? fuzzyworm Programming 5 02-05-2004 04:55 PM
I would like to open up windows.exe files bruce1271 Linux - Software 5 01-20-2004 07:36 PM
If *.exe for Windows what is for LinuX? Nukem Linux - Newbie 4 10-05-2003 05:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:49 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