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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-29-2003, 08:57 AM
|
#1
|
Member
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252
Rep:
|
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
|
|
|
08-29-2003, 10:06 AM
|
#3
|
Senior Member
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123
Rep:
|
As long as you don't write programs in windows that need windows libraries, you can compile c++ on GNU with g++.
|
|
|
08-29-2003, 10:18 AM
|
#4
|
Member
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252
Original Poster
Rep:
|
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?
|
|
|
08-29-2003, 10:20 AM
|
#5
|
Senior Member
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123
Rep:
|
You might be using libraries g++ doesn't have, can you post the source?
|
|
|
08-29-2003, 10:46 AM
|
#6
|
Member
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252
Original Poster
Rep:
|
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';
}
|
|
|
08-29-2003, 11:36 AM
|
#7
|
Senior Member
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|