Newbie / Visual C++ error
Okay, I got the book Game Programming All in One by Bruno Miguel Teixeira de Sousa. I''m on the very first example and am already having trouble, I think the code is all input correctly but when I press ctrl+f5 to compile it I get the following errors.
The Code is here --->
/* ''01main.cpp'' */
/* Input output stream header file */
#include <iostream>
/* Start */
main (void)
{
std::cout << "Hello all you happy people" << std::endl;
return 0;
}
The Errors are here --->
_____
These project configuration(s) are out of date:
filename - Debug Win32
Would you like to build them?
_____
Yes
_____
There were build errors. Continue?
_____
Yes
____
Unable to start debugging
Unable to start program ''c:\AllinOne\filename\Debug\filename.exe''
The system cannot find the file specified
____
I''m hoping it''s something simple or something a little over my head at this point cos it''s sort of ridiculous to be stuck on the "Hello World" type of example.
Thanks.
Ok, if there were build errors, the executable was never created. So when you said continue --> yes after the compiler asked you, it could not find the app to start.
Select no when it asks if there are build errors and do you want to continue.
Also, the code for the most part looks ok except for your main declaration.
Try this:
Alek
Select no when it asks if there are build errors and do you want to continue.
Also, the code for the most part looks ok except for your main declaration.
Try this:
int main(int argc, char* argv[]){ std::cout << "Hello all you happy people" << std::endl; return 0;}
Alek
you don''t have to include "int argc, char* argv[]", but be sure to use int main() or int main(void) would work despite its redundant parameter.
What are the build errors?
There should be some stuff spit out in a frame (at the bottom by default), which tells the build errors.
Tadd
- WarbleWare
There should be some stuff spit out in a frame (at the bottom by default), which tells the build errors.
Tadd
- WarbleWare
Thanks for the replies but I''m still at the same spot.
My current code is --->
/* ''01main.cpp'' */
/* Input output stream header file */
#include <iostream>
/* Start */
int main()
{
std::cout << "Hello all you happy people" << std::endl;
return 0;
}
Error description --->
c:\AllInOne\Chapter01\01main.cpp(12): fatal error C1010: unexpected end of file while looking for precompiled header directive
My current code is --->
/* ''01main.cpp'' */
/* Input output stream header file */
#include <iostream>
/* Start */
int main()
{
std::cout << "Hello all you happy people" << std::endl;
return 0;
}
Error description --->
c:\AllInOne\Chapter01\01main.cpp(12): fatal error C1010: unexpected end of file while looking for precompiled header directive
I think it may be because C++ does not support the default int rule, main() needs to be explicitly declared int.
Try this.
#include<iostream>
using namespace std;
int main(void)
{
cout<<"Hello people";
return 0;
}
#include<iostream>
using namespace std;
int main(void)
{
cout<<"Hello people";
return 0;
}
disable precompiled headers:
(assuming vc++ 6)
project menu / settings / c++ tab / precompiled header category / select "not using precompiled headers".
should work then.
for precompiled header you have to use stdafx.h I think. Maybe someone who knows more about precompiled headers will explain more if you''re interested.
(assuming vc++ 6)
project menu / settings / c++ tab / precompiled header category / select "not using precompiled headers".
should work then.
for precompiled header you have to use stdafx.h I think. Maybe someone who knows more about precompiled headers will explain more if you''re interested.
To get rid of the build error message go to project->Settings->C++ tab->
Under category, select precompiled headers, and then select not using precomiled headers. Click ok, rebuild project.
[EDIT] Too slow. dough [/EDIT]
[edited by - pjcast on December 16, 2003 7:18:28 PM]
Under category, select precompiled headers, and then select not using precomiled headers. Click ok, rebuild project.
[EDIT] Too slow. dough [/EDIT]
[edited by - pjcast on December 16, 2003 7:18:28 PM]
nope, but thanks.
So my current code is -->
#include
using namespace std;
int main(void)
{
cout<<"Hello people";
return 0;
}
I get the same sequence of errors and my error description is -->
c:\AllInOne\Chapter01\01main.cpp(10): fatal error C1010: unexpected end of file while looking for precompiled header directive
So my current code is -->
#include
using namespace std;
int main(void)
{
cout<<"Hello people";
return 0;
}
I get the same sequence of errors and my error description is -->
c:\AllInOne\Chapter01\01main.cpp(10): fatal error C1010: unexpected end of file while looking for precompiled header directive
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement