It is currently Mon Jul 28, 2014 9:28 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: [C++] First program and it won't compile
PostPosted: Sat May 01, 2010 9:13 pm 
Offline
User avatar
.: Level III :.

Joined: Thu Aug 14, 2008 2:16 am
Posts: 460
iTrader:
Gender: None specified
Cash:130
Reputation point: 17
Icegoten will become famous soon enough
Code:
/*
   This program displays "I love C++" to the Standard Output
*/

#include <iostream>

int main ()
{ std::cout << "I Love C++";
return 0;
}


I was following a book from 2003 and trying to adjust to changes since most of the websites, programs, and downloads they use and mention are gone or so outdated they don't work anymore.

I did manage to get Dev C++ 4.9.9.2 to compile. I typed in the above code and when I click on compile it says "Source file not compiled"

I don't know what I'm doing wrong and if you need more information I can tell you but I don't know what else I could tell you that would help right now.

_________________
[GUIDES]
Cellblock in 7 moves - viewtopic.php?f=79&t=18622

Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sat May 01, 2010 9:15 pm 
Offline
User avatar
.: Level IV :.

Joined: Mon Dec 25, 2006 5:34 am
Posts: 2905
Location: <(^_^)>
iTrader:
Gender: Female
Cash:1658
Reputation point: 133
Angelika is a name known to allAngelika is a name known to allAngelika is a name known to allAngelika is a name known to allAngelika is a name known to allAngelika is a name known to all


Content Giveaway Donor Award Graphics Winner Award

Did you read the manual?

_________________


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sun May 02, 2010 12:31 am 
Offline
User avatar
.: Admin :.

Joined: Fri Nov 10, 2006 4:48 pm
Posts: 1864
Location: Naples, Italy
iTrader:
Gender: Male
Cash:1504
Reputation point: 278
ricky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant future


Giveaway Donor Award Graphics Trader Winner Award

Are you sure you clicked "compile" and not just "run"? If so, try pressing "Compile & run". If it still doesn't work, please post the compiler log here

_________________
Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sun May 02, 2010 12:34 am 
Offline
User avatar
.: Level V :.

Joined: Thu Feb 12, 2009 2:35 am
Posts: 1327
Location: USA
iTrader:
Gender: Female
Cash:328
Reputation point: 344
Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!Anfan has a reputation beyond repute!


Content Giveaway Donor Award Trader Winner Award

Alright, well, I just did compile/run on Dev C++, and it ran fine.

Do you have all the basic libraries/header files and such included? (They *should* be by default, but it doesn't make any sense if that can't compile source code.)

_________________


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sun May 02, 2010 9:14 am 
Offline
User avatar
.: Level IV :.

Joined: Sat Mar 01, 2008 9:05 am
Posts: 835
iTrader:
Gender: Male
Cash:797
Reputation point: 63
assasin89 is a glorious beacon of lightassasin89 is a glorious beacon of lightassasin89 is a glorious beacon of light


Giveaway Donor Award Trader Winner Award

You have to save your program in .cpp format not in .c(Dev c++ doesnt take .c correctly).

After saving then try again it should work!!


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sun May 02, 2010 7:50 pm 
Offline
User avatar
.: Level III :.

Joined: Thu Aug 14, 2008 2:16 am
Posts: 460
iTrader:
Gender: None specified
Cash:130
Reputation point: 17
Icegoten will become famous soon enough
Anfan wrote:
Alright, well, I just did compile/run on Dev C++, and it ran fine.

Do you have all the basic libraries/header files and such included? (They *should* be by default, but it doesn't make any sense if that can't compile source code.)


Well this is probably the problem and I didn't see anything about this on their site when I downloaded it.

ricky92 wrote:
Are you sure you clicked "compile" and not just "run"? If so, try pressing "Compile & run". If it still doesn't work, please post the compiler log here


I clicked compile alone. Clicked run alone. Clicked Compile & Run alone. They all didn't do it for me.

Here is the log
Code:
Compiler: Default compiler
C:\CPPFiles\ILoveCPlusPlus.cpp
Compiling
Done.

_________________
[GUIDES]
Cellblock in 7 moves - viewtopic.php?f=79&t=18622

Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sun May 02, 2010 8:46 pm 
Offline
User avatar
.: Admin :.

Joined: Sun Mar 02, 2008 5:00 am
Posts: 3003
Location: Home sweet home
iTrader:
Gender: Male
Cash:3460
Reputation point: 519
Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!


Content Giveaway Donor Award Trader Winner Award

What operating system are you running?

_________________
Programs
AB List Creator ~ Account Generator

Guides
Employment Agency ~ NeoAcademy HowTo ~ List of Guides ~ Game Score Review List ~ Starting up (again) After Getting Iced ~ Packrat Avatar List ~ Top Gamer Avatar Game List ~ Avatar Game List ~ Roodoku Guide ~ Altador Cup Player Avatar ~ GM Scripts ~ Autobuying Shop Guide ~ Ways of Making NP ~ Neoquest 3D ~ IP Addresses

Helpful Threads
Taking AB List Requests ~ AB Lists ~ Updated Igloo AB List

Code Snippets
[Java] HTTP Wrapper ~ [Java] Neopets Wrapper ~ [Java] Proxy Support ~ [Java] Smart Haggle


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Sun May 02, 2010 10:43 pm 
Offline
User avatar
.: Level III :.

Joined: Thu Aug 14, 2008 2:16 am
Posts: 460
iTrader:
Gender: None specified
Cash:130
Reputation point: 17
Icegoten will become famous soon enough
Windows 7 64-Bit

_________________
[GUIDES]
Cellblock in 7 moves - viewtopic.php?f=79&t=18622

Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Mon May 03, 2010 12:55 am 
Offline
User avatar
.: Admin :.

Joined: Sun Mar 02, 2008 5:00 am
Posts: 3003
Location: Home sweet home
iTrader:
Gender: Male
Cash:3460
Reputation point: 519
Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!Zer0 has a reputation beyond repute!


Content Giveaway Donor Award Trader Winner Award

Hm, try looking into this http://www.pmohan.org/content/view/36/1/

_________________
Programs
AB List Creator ~ Account Generator

Guides
Employment Agency ~ NeoAcademy HowTo ~ List of Guides ~ Game Score Review List ~ Starting up (again) After Getting Iced ~ Packrat Avatar List ~ Top Gamer Avatar Game List ~ Avatar Game List ~ Roodoku Guide ~ Altador Cup Player Avatar ~ GM Scripts ~ Autobuying Shop Guide ~ Ways of Making NP ~ Neoquest 3D ~ IP Addresses

Helpful Threads
Taking AB List Requests ~ AB Lists ~ Updated Igloo AB List

Code Snippets
[Java] HTTP Wrapper ~ [Java] Neopets Wrapper ~ [Java] Proxy Support ~ [Java] Smart Haggle


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Mon May 03, 2010 3:36 am 
Offline
User avatar
.: Level III :.

Joined: Thu Aug 14, 2008 2:16 am
Posts: 460
iTrader:
Gender: None specified
Cash:130
Reputation point: 17
Icegoten will become famous soon enough
Thank you Zero! That fixed the problem. Now I can continue learning.

_________________
[GUIDES]
Cellblock in 7 moves - viewtopic.php?f=79&t=18622

Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Mon May 03, 2010 1:00 pm 
Offline
User avatar
.: Admin :.

Joined: Fri Nov 10, 2006 4:48 pm
Posts: 1864
Location: Naples, Italy
iTrader:
Gender: Male
Cash:1504
Reputation point: 278
ricky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant future


Giveaway Donor Award Graphics Trader Winner Award

Icegoten wrote:
Windows 7 64-Bit

Hmmm that might be a problem. I *think* the included mingw doesn't support 64-bit, so you might have to look into it. Try using the XP mode in windows 7? If it can handle a 32 bit XP operating system, everything should compile fine (on the virtual machine, of course).

_________________
Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Mon May 03, 2010 8:44 pm 
Offline
User avatar
.: Level III :.

Joined: Thu Aug 14, 2008 2:16 am
Posts: 460
iTrader:
Gender: None specified
Cash:130
Reputation point: 17
Icegoten will become famous soon enough
So if I wanted to continue just doing everything on 64-bit I should look for a new compiler? Or is 64-bit the actual problem?

_________________
[GUIDES]
Cellblock in 7 moves - viewtopic.php?f=79&t=18622

Image


Top
 Profile  
 
 Post subject: Re: [C++] First program and it won't compile
PostPosted: Mon May 03, 2010 9:30 pm 
Offline
User avatar
.: Admin :.

Joined: Fri Nov 10, 2006 4:48 pm
Posts: 1864
Location: Naples, Italy
iTrader:
Gender: Male
Cash:1504
Reputation point: 278
ricky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant futurericky92 has a brilliant future


Giveaway Donor Award Graphics Trader Winner Award

Icegoten wrote:
So if I wanted to continue just doing everything on 64-bit I should look for a new compiler? Or is 64-bit the actual problem?

Actually, I have no experience on 64-bit windows OS'es, so I can't be sure. I think everything should still compile fine (afterall there's 32bit support for a reason) but it won't be optimized. You probably won't care as for the moment you're just doing basic standard input/output stuff, so w/e :P

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
* FAQ

Powered by phpBB © 2000- phpBB Group
NEOPETS, characters, logos, names and all related indicia are trademarks of Neopets, Inc., © 1999-. © denotes Reg. US Pat. & TM Office. All rights reserved.
Website © neofriends.net - this site is in no way affiliated with Neopets, Inc or Viacom International, Inc.

phpBB SEO