#### Archived

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

# 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.

## 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 on other sites
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 on other sites
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 on other sites
Do you have a carriage return after the inclusion guard in "apstring.h"?

##### 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 on other sites
The AP is closest.

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 on other sites
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 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 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 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).

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 9
• 9
• 46
• 41
• ### Forum Statistics

• Total Topics
631750
• Total Posts
3002067
×