I thought constructors had no return types?!

Started by
14 comments, last by Paulius Maruska 17 years, 8 months ago
Files with a .c extension are (or can be) still compiled as C code. But that's not the issue; the error message is one that occurs only when using C++.

There's likely a lot more wrong with your program than just not including the headers properly, and it only just surfaced because you started correctly including them. Post the first few errors and the source files they refer to.
Advertisement
Ok, here are some:

Error 130 error C2059: syntax error : ')' g:\rpgdx\gamecores\inputcore\inputcore\core_input.cpp 29

Error 53 error C2061: syntax error : identifier 'BOOL' g:\rpgdx\gamecores\inputcore\inputcore\core_input.h 76

Error 4 error C2143: syntax error : missing ';' before '*' g:\rpgdx\gamecores\inputcore\inputcore\core_input.h 42

Error 119 error C2143: syntax error : missing ';' before 'cInput::GethWnd' g:\rpgdx\gamecores\inputcore\inputcore\core_input.cpp 19

Error 117 error C2227: left of '->Clear' must point to class/struct/union/generic type g:\rpgdx\gamecores\inputcore\inputcore\core_input.cpp 11

Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int g:\rpgdx\gamecores\inputcore\inputcore\core_input.h 41

Error 116 error C2065: 'm_pDI' : undeclared identifier g:\rpgdx\gamecores\inputcore\inputcore\core_input.cpp 11


-Stenny :)

---EDIT---
I know I might not have put a ; somewhere but I have no idea where...Also, I find it very strange the IDE doesn't recognize a BOOL. And yes, I use a Win32 Application project (Multi-Byte)
What do I expect? A young man's quest to defeat an evil sorceror while discovering the truth of his origins. A plucky youngster attended by her brutish guardian. A powerful artifact which has been broken into a small number of artifactlets distributed around the world.What do I want? Fewer damn cliches. - Sneftel
BOOL is defined in windef.h header.
You must include windows.h somewhere before you use the types like BOOL, HWND etc.
Remember that C++ is case sensitive. bool is the builtin datatype. BOOL is going to be either a #define or a typedef.

"I can't believe I'm defending logic to a turing machine." - Kent Woolworth [Other Space]

I included windows.h in Core_Global.h

-Stenny
What do I expect? A young man's quest to defeat an evil sorceror while discovering the truth of his origins. A plucky youngster attended by her brutish guardian. A powerful artifact which has been broken into a small number of artifactlets distributed around the world.What do I want? Fewer damn cliches. - Sneftel
Quote:Original post by stenny
I included windows.h in Core_Global.h

-Stenny

But you didn't include it in Core_Input.cpp!
You should either include windows.h or Core_Global.h into your Core_Input.cpp file.

This topic is closed to new replies.

Advertisement