Jump to content
  • Advertisement

Archived

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

ageny6

What is wrong with c++???

This topic is 5532 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, here is the deal. My program was working fine the night before. But right about 10 minutes ago, I changed functions from _putch to cout<< in about 3 lines of code and included the library concequently. No biggy, right? Well, when I compiled, I got a real suprize. My compiler is giving me a insteresting new error that I have never even heard about. For example, the set of code before the main: #include "apstring.h" int GetPlayerOption(); gives this error: error C2143: syntax error : missing '';'' before ''PCH creation point'' pointing at the function decleration line int GetPlayerOption();... And then this error is repeated for every single line of code in my driver.cpp file (the file with the code above). What in the world is this error??? Jonathan

Share this post


Link to post
Share on other sites
Advertisement
Check out "apstring.h". It might be in there.



Rob Loach
Current Project: Go Through Object-Oriented Programming in C++ by Robert Lafore

"Do or do not. There is no try."
- Yoda

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Are you using Visual Studio? Delete all the files except for your .dsw, .dsp, and of course your source code. Be sure to delete the Debug and Release folders. This will force Studio to rebuild all those files and redo the precompiled headers. That often fixes this problem for me. If your not using Studio, then, umm, next?

Share this post


Link to post
Share on other sites
Also, try using:
#include <apstring.h> 

I doubt it''ll help, but might as well try.



Rob Loach
Current Project: Go Through Object-Oriented Programming in C++ by Robert Lafore

"Do or do not. There is no try."
- Yoda

Share this post


Link to post
Share on other sites
The AP is closest.

PCH = PreCompiled Headers

Its complaining because it can''t find the header it wants for precompiled headers, typically this is named something like StdAfx.h in your project. Check your project settings and look for an option relating to precompiled headers--try turning it off.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
thats not the problem at all. at the very top of your program, add #include "stdafx.h" before everything else. tat will fix it.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
thats not the problem at all. at the very top of your program, add #include "stdafx.h" before everything else. tat will fix it.


Actually, that''s only a fix because of the PCH.




-~-The Cow of Darkness-~-

If you see the image I am online

Share this post


Link to post
Share on other sites
i''ve had this happen. What I did was put all my #include statements into the file stdafx.h and #include stdafx.h in all the files instead of #including you''re files directly. I know, it''s a pain, hope that helps!

Share this post


Link to post
Share on other sites
Listen to antareus. He''s the only one who completely understands what he''s saying. Oh, and learn your IDE. It often has requirements that extend beyond the language (like PCHs).

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!