New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

OS 10.4x - Compiler ...


Post Reply New Thread Subscribe

 
Thread Tools
A.I. BOT
Guest
 
Posts: n/a

I have a stupid problem. I made a C++ file called test.cpp. It has the fallowing contents:

Code:
#include <cstdlib>
#include <iostream>
using namespace std;

int main() {
   cout << "Hello, World!" << endl;
   return 0;
}
Now, I ran
Quote:
wiley:~ whammy$ g++ /Users/Whammy/Desktop/test.cpp
wiley:~ whammy$
Which I guess it means it worked, due to I see no errors. So I go to my desktop and see no compiled programm. I check my "Whammy" directory and I see a file named a.out which was produced by the compiler, It has a bunch of stuff in it that weird.

How can I get my compiler to work correctly?? so that it produces a programm rather then a a.out file.

Thanks.
QUOTE Thanks
A.I. BOT
Guest
 
Posts: n/a

OMG im stupid >.< ./a.out and it shows my programm i feel stupid now
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
You have forgetten that if you don't given the compiler a file name for the executable, that is will use the default of a.out.

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks

Post Reply New Thread Subscribe


« MacAddict Backup Script | Scheduled Backup With Dejavu - Cannot backup »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
C++ Compiler/ Visual Studio Alternative? echo12 Running Windows (or anything else) on your Mac 3 08-25-2004 06:36 PM
Xcode C++ Compiler error steved3298 OS X - Development and Darwin 2 07-22-2004 12:02 AM
linux user thinking about switching moro Switcher Hangout 18 11-13-2003 01:50 PM

All times are GMT -4. The time now is 03:31 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?