Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nh

Newbie / Visual C++ error

This topic is 5423 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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:


int main(int argc, char* argv[])
{
std::cout << "Hello all you happy people" << std::endl;

return 0;
}


Alek

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try this.

#include<iostream>
using namespace std;

int main(void)
{
cout<<"Hello people";

return 0;
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!