-
header problem.
So I have this project with bunch of headers included in core.h. main.cpp is included the core.h. Every header files included the core.h because the stdlib, directx headers and etc.
Now I created a core class in core.h that has an object inside and shows errors
error C2146: syntax error : missing ';' before identifier 'md2'
Code:
#ifndef CORE_H
#define CORE_H
//Bunch of headers with the MD2Model.h
class Core
{
public:
MD2Model md2;
};
#endif
How can I fix this? I just want main.cpp to include one header file to use my engine.
Thank you very much
Sarah22
-
The error message seems to suggest that MD2Model isn't recognized as a class name. So be sure the appropriate header appears before this declaration.
If you're willing to deal with a large file, you can just preprocess the file and see what the compiler is seeing. (Assuming Visual Studio, you can go to project properties, C/C++, preprocessor.) This way you can see what happened with your headers.