![]() |
|
#1
|
|||
|
|||
What's wrong?Hello guys,
Today I started C++ but it was a bad start. The code below is compiled in MS VS 6.0, but not build. I study C++ form my book (Deitel&Deitel), everything looks ok but I cant find where is the error. And this is the error message... CPP / C++ / C Code:
CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
|
you forgot the .h in #include <iostream>. Some compilers can be a bit picky, but I compiled this in Dev C++ and it worked perfectly fine. Or atleast it compiled, in other words.
Looks like you have a compiler issue on your hands. A couple of libraries or objects referenced in the wrong way? Misconfiguration as far as I know from the output. Try reinstalling. |
|
#3
|
|||
|
|||
|
Quote:
I dont think it is about iostream... When I change iostream to iostream.h this is happened:: CPP / C++ / C Code:
|
|
#4
|
|||
|
|||
|
When I program, I like to program so that it's the easiest and neatest way possible, to avoid any syntax errors.
CPP / C++ / C Code:
I'm not able to test this at this moment, but try it now. |
|
#5
|
||||
|
||||
|
Aliok, it has to be a problem with your MSV. It compiles and executes fine for me on W2K cygwin g++.
Jeremiah, do some searches here and find out about the <iostream> vs. <iostream.h> You are suggesting to use old syntax. Dropping the .h is the correct thing to do. Leaving it there is deprecated or antiquated. Including without the .h allows inclusion into the std namespace. There is a lot of good info both here and that going a-googling will get you. My output (with the .h) Code:
Mark __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
|
#6
|
|||
|
|||
|
Quote:
There is nothing wrong with your original C++ code. It will compile and execute perfectly with Visual C++. If you are using the Integrated Development Environment, how do you have your project set up? Should be a "Win32 Console Application". If you are using command line compiler (cl.exe) are the environment variables set properly for Visual C++? Make sure your source file has .cpp extension. (Like main.cpp or test.cpp or something like that.) Regards, Dave [edit] Is this a new installation of VS 6? How did you install it? Any interesting events during the installation (error/warning messages, etc.) Have you successfully created any C programs or any other C++ programs with this installation? [/edit] Last edited by davekw7x : 03-Jul-2005 at 15:42.
|
|
#7
|
||||
|
||||
|
Quote:
__________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#8
|
|||
|
|||
re:Thanx everyone.. I think the problem is my VS6. Devcpp compiles and builds it perfectly
I think VS2003 .NET changed configuration of VS6. By the way, is there anyone uses VS2003 .NET??? I cant find how to compile with it. Rookie |
|
#9
|
|||
|
|||
|
Quote:
Quote:
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with if statement (was: what is wrong???) | rubenryhan | C Programming Language | 2 | 02-May-2005 09:09 |
| Functions and Classes - Where did I go wrong? | redmage | C++ Forum | 5 | 10-Apr-2005 19:31 |
| Something's wrong w/my program. | agentxx04 | C Programming Language | 1 | 07-Nov-2004 11:03 |
| where am i going wrong? | nkhambal | C Programming Language | 5 | 03-Aug-2004 08:36 |
| something wrong with this code | loon | MySQL / PHP Forum | 5 | 07-Jul-2003 06:55 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The