Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-23-2005, 04:53 AM   #1 (permalink)
 
Newb Techie

Join Date: Jul 2004

Posts: 20

demented_devil

Default C++ problems

i did the hello world code and tried to compile it but when i try to i get it saying:
Compiler: Default compiler
Executing g++.exe...
g++.exe"C:\My Documents\hello world.cpp" -o "C:\My Documents\hello world.exe"
Execution terminated
demented_devil is offline  
Old 03-23-2005, 09:32 AM   #2 (permalink)
 
Ultra Techie

Join Date: Oct 2003

Posts: 544

fitzjj

Default

It looks like you are compiling "hello world.cpp" with the output file (the program) being called "hello world.exe" which is fine and you dont seem to be getting any errors, again this is good. You now need to run the program (which you have created by compiling your source code). Find "hello world.exe" and run it. You should see "Hello World" displayed on the screen in a command line window.

One suggestion though, i would avoid using spaces in names since makes things confusing. Generally, being a java programmer i would have called it HelloWorld.exe or helloWorld.exe with the capital letter indicating a new word. Some like to use underscores (i may be wrong but i think this is what they like in c++), so it would be named hello_world.exe. Just a small point but it'll probably save you some confusion in the future.
fitzjj is offline  
Old 03-23-2005, 11:07 AM   #3 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

And don't use hyphens in your names either. Because some programs use a hyphen as an option descriptor.
For example Hello-World some programs may read that as Hello being the program name and -World being an option.

__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
Old 03-24-2005, 03:20 AM   #4 (permalink)
 
Newb Techie

Join Date: Jul 2004

Posts: 20

demented_devil

Default

ok thanks
demented_devil is offline  
Old 03-24-2005, 03:26 AM   #5 (permalink)
 
Newb Techie

Join Date: Jul 2004

Posts: 20

demented_devil

Default

i just realized that i can't compile anything i tried one of the hello examples they provide and i can't even compile the thing and run it it's a load of ****
demented_devil is offline  
Old 03-25-2005, 01:13 AM   #6 (permalink)
 
Super Techie

Join Date: Jan 2005

Posts: 295

gab00n

Default

Then get a different compiler, bloodshed.net has a good one.
__________________
\"Today\'s scientists have substituted mathematics for experiments, and they wander off through equation after equation, and eventually build a structure which has no relation to reality.\" Nikola Tesla
gab00n is offline  
Old 03-25-2005, 04:47 AM   #7 (permalink)
 
Newb Techie

Join Date: Jul 2004

Posts: 20

demented_devil

Default

how do u use it do u just download it and it works when u open c++
demented_devil is offline  
Old 03-25-2005, 04:56 PM   #8 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

That's what the DOCUMENTATION is for. We're not going to spoon feed you. :|
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
Old 03-26-2005, 12:42 AM   #9 (permalink)
 
Newb Techie

Join Date: Jul 2004

Posts: 20

demented_devil

Default

sorry for offending u ur highness
demented_devil is offline  
 
Closed Thread

Thread Tools
Display Modes

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 On