Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 21st, 2008, 1:24 PM   #11
JAlexBrown
Newbie
 
Join Date: May 2008
Posts: 11
Rep Power: 0 JAlexBrown is on a distinguished road
Re: C++ compilers?

When I first starting using C++, I used Microsoft Visual C++ 2003, an it worked just fine for me. Of course I was also in a high school class, so I had an instructor. I've used Dev-C++ before, and from what I recollect, it was fine for starting out. I'm sure a beginner won't notice the features that it's missing until he/she moves on to something more complex.
JAlexBrown is offline   Reply With Quote
Old May 21st, 2008, 10:19 PM   #12
H0ndaM4n
Newbie
 
H0ndaM4n's Avatar
 
Join Date: May 2008
Location: North Dakota
Posts: 7
Rep Power: 0 H0ndaM4n is on a distinguished road
Send a message via MSN to H0ndaM4n
Re: C++ compilers? (sorry for the long message)

Ok, so I downloaded that Visual studio, and I tried to make a "Hello World" program. It didn't work. it just gave me a bunch of errors.

c Syntax (Toggle Plain Text)
  1. /*my hello program with comments*/
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. cout <<"Hello World!";//Prints Hello World
  8. cout <<"I'm a C++ Program!";//Prints I'm a C++ program return 0;
  9. }
there is my code. then i click the build tab, then Build Hello World, and this comes up
Quote:
------ Build started: Project: hello world, Configuration: Debug Win32 ------
Compiling...
Hello.cpp
c:\documents and settings\aaron friedt\my documents\visual studio 2008\projects\hello world\hello world\hello.cpp(3) : error C2653: 'Hello' : is not a class or namespace name
c:\documents and settings\aaron friedt\my documents\visual studio 2008\projects\hello world\hello world\hello.cpp(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\documents and settings\aaron friedt\my documents\visual studio 2008\projects\hello world\hello world\hello.cpp(5) : warning C4508: 'Hello' : function should return a value; 'void' return type assumed
c:\documents and settings\aaron friedt\my documents\visual studio 2008\projects\hello world\hello world\hello.cpp(7) : error C2653: 'Hello' : is not a class or namespace name
c:\documents and settings\aaron friedt\my documents\visual studio 2008\projects\hello world\hello world\hello.cpp(7) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Build log was saved at "file://c:\Documents and Settings\Aaron Friedt\My Documents\Visual Studio 2008\Projects\hello world\hello world\Debug\BuildLog.htm"
hello world - 4 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What is wrong?

Last edited by big_k105; May 28th, 2008 at 9:11 AM.
H0ndaM4n is offline   Reply With Quote
Old May 22nd, 2008, 3:41 PM   #13
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 87
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
Re: C++ compilers?

return 0; needs to be on a new line. Other than that I really don't see a reason it should fail. Are you sure that's all your code?
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote
Old May 22nd, 2008, 5:06 PM   #14
H0ndaM4n
Newbie
 
H0ndaM4n's Avatar
 
Join Date: May 2008
Location: North Dakota
Posts: 7
Rep Power: 0 H0ndaM4n is on a distinguished road
Send a message via MSN to H0ndaM4n
Re: C++ compilers?

that is all of my code.
__________________
*%>>Fr13Dt0<<%*
H0ndaM4n is offline   Reply With Quote
Old May 26th, 2008, 12:17 PM   #15
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 239
Rep Power: 3 Soulstorm is on a distinguished road
Re: C++ compilers?

The above code is correct, and I don't see any reason it should fail, even if you don't place "return 0" in a new line. I would assume there is something wrong with your Visual Studio installation.

And please use code tags next time, as it makes your code much easier for us to read.
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old May 26th, 2008, 2:04 PM   #16
gogoc
Newbie
 
Join Date: May 2008
Posts: 1
Rep Power: 0 gogoc is on a distinguished road
Re: C++ compilers?

g++ will work for u
u can get it in MinGW for windows and for linux, there are many packages available
u can also configure it with eclipse and harness the feature of eclipse
gogoc is offline   Reply With Quote
Old May 27th, 2008, 11:17 PM   #17
H0ndaM4n
Newbie
 
H0ndaM4n's Avatar
 
Join Date: May 2008
Location: North Dakota
Posts: 7
Rep Power: 0 H0ndaM4n is on a distinguished road
Send a message via MSN to H0ndaM4n
Re: C++ compilers?

I'm using microsoft visual C++ as a compilor, but i'm coding in C++, not visual C++. Could that be the problem? Also, on one of the little tutorials that came w/ the program, it drug me thru some thing where i had to make a class and stuff, do i need to do that?
__________________
*%>>Fr13Dt0<<%*
H0ndaM4n is offline   Reply With Quote
Old May 27th, 2008, 11:48 PM   #18
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
Re: C++ compilers?

Visual C++ is just the name of the IDE, the language is still C++. "Visual" is sort of the branding used by Microsoft: Visual C++, Visual C#, Visual Basic, and Visual Web Developer make up Visual Studio. I'm really not sure how this problem could be though; I tried it in Visual Studio and it worked fine for me.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old May 28th, 2008, 3:36 AM   #19
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,207
Rep Power: 5 grumpy is on a distinguished road
Re: C++ compilers?

My guess is that you've paraphrased your code, and not posted the actual code you fed to your compiler. Based on that guess, you probably left out a character somewhere and/or commented out something you didn't intend.
grumpy is offline   Reply With Quote
Old May 28th, 2008, 12:50 PM   #20
mbd
Programmer
 
Join Date: Nov 2007
Posts: 86
Rep Power: 1 mbd is on a distinguished road
Re: C++ compilers?

what type of project did you create? you should have created an "Empty Project". then you should go to the menu and choose "Project" > "Add New Item ...". Then you should choose Visual C++ as the category and "C++ File (.cpp)" from the right side. Then paste your code into that file and build.
mbd is offline   Reply With Quote
Reply

Bookmarks

Tags
question on compilers

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best compilers sayu Community Announcements and Feedback 3 Nov 19th, 2006 2:27 AM
whats up with those $300 compilers hervens48 C++ 18 May 3rd, 2006 2:28 AM
which is the best compiler for c++ biohazard C++ 16 Mar 3rd, 2006 8:29 PM
Python compilers Indigno Python 7 Mar 2nd, 2006 4:15 PM
How compilers work? layer Coder's Corner Lounge 53 May 24th, 2005 12:04 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC