Question for starting projects in VC++ Express
I personally use the blank project all the time... For Win32, OGL,
command line, etc programs.
command line, etc programs.
When I try to compile my project, I get the error:
------ Build started: Project: hi world, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\documents and settings\kyle\my documents\visual studio 2005\projects\hi world\hi world\main.cpp(1) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
Build log was saved at "file://c:\Documents and Settings\Kyle\My Documents\Visual Studio 2005\Projects\hi world\hi world\Debug\BuildLog.htm"
hi world - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
------ Build started: Project: hi world, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\documents and settings\kyle\my documents\visual studio 2005\projects\hi world\hi world\main.cpp(1) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
Build log was saved at "file://c:\Documents and Settings\Kyle\My Documents\Visual Studio 2005\Projects\hi world\hi world\Debug\BuildLog.htm"
hi world - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Are you including it like this?
The brackets <> tells the preprocessor to look into the directory
paths set by the PATH compilier settings, which normally includes
the standard library.
If the above gives the same error, something may be wrong with your
compiliers' path settings.
In C++, it is recommend to use <iostream> instead of <iostream.h>
#include <iostream> // Note the brackets <> and no *.h
The brackets <> tells the preprocessor to look into the directory
paths set by the PATH compilier settings, which normally includes
the standard library.
If the above gives the same error, something may be wrong with your
compiliers' path settings.
In C++, it is recommend to use <iostream> instead of <iostream.h>
I switched it to just regular iostream instead of iostream.h and got this...
------ Build started: Project: hi world, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\documents and settings\kyle\my documents\visual studio 2005\projects\hi world\hi world\main.cpp(5) : error C2065: 'cout' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Kyle\My Documents\Visual Studio 2005\Projects\hi world\hi world\Debug\BuildLog.htm"
hi world - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Do I have to download that Microsoft Platform SDK cuz I dont have that right now?
my code right now is:
#include <iostream>
int main ()
{
cout << "Hello World!\n";
return 0;
}
------ Build started: Project: hi world, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\documents and settings\kyle\my documents\visual studio 2005\projects\hi world\hi world\main.cpp(5) : error C2065: 'cout' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Kyle\My Documents\Visual Studio 2005\Projects\hi world\hi world\Debug\BuildLog.htm"
hi world - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Do I have to download that Microsoft Platform SDK cuz I dont have that right now?
my code right now is:
#include <iostream>
int main ()
{
cout << "Hello World!\n";
return 0;
}
Try this:
"cout" is part of the std namespace. Adding using namespace std
includes this namespace so the compilier can see what "cout" is.
#include <iostream>using namespace std;int main (){cout << "Hello World!\n";return 0;}
"cout" is part of the std namespace. Adding using namespace std
includes this namespace so the compilier can see what "cout" is.
Okay that worked, this tutorial I'm using must suck or something...
http://newdata.box.sk/bx/c/
Do you think I should keep using that or should I use something else? Recommendations?
Also, should I download the MS Platform SDK for VC++ Express?
http://newdata.box.sk/bx/c/
Do you think I should keep using that or should I use something else? Recommendations?
Also, should I download the MS Platform SDK for VC++ Express?
Use some other tutorial. That one doesn't follow the latest supported C++ Standards. You'll receive countless headaches trying to enter code which wont compile, while also learning deprecated syntax.
Cheers!
Cheers!
I personally recommend This site
Direct link to the tutorial
This contains a nice set of beginning C++ tutorials and refrence.
Also, do not worry about the Win32 PSDK until you are ready for it.
For now, focus on learning the language itself. Once you get more
experienced--and are still with C++--then try it out[smile]
Dont run before you can walk[smile]
Whatever you choose though, good luck!
Direct link to the tutorial
This contains a nice set of beginning C++ tutorials and refrence.
Also, do not worry about the Win32 PSDK until you are ready for it.
For now, focus on learning the language itself. Once you get more
experienced--and are still with C++--then try it out[smile]
Dont run before you can walk[smile]
Whatever you choose though, good luck!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement