I am a C/C++ newbie, so this might be a dumb question,
I have the following problem, I have a method in a c++ lib which is exported using
extern ‘C’ and it is being called by another method from a different c file.
So, I needed some structures in the c++ code, so the “smart” thing to do seemed to be simply add the structures to the .h file of the first class and import it. When I did so, the strangest thing happened. The C code which worked fine, broke saying three stupid things (note that the structures were simply moved from the code to the header). So, I have 3 instances, read errors, saying:
- Expected ; before * token;
- Iso C++ forbids declaration of ‘someclassname’ with no type
- type ‘someclassname’ could not be resolved
Any ideas?
The compiler thinks that “someclassname” is a variable name. You wrote something like
And the compiler thinks you gave the name of an undeclared variable, Employee, complained about that, complained that a * doesn’t go after a variable name, and so on.
Go look at where you think you’re explaining what “someclassname” is, because the compiler isn’t getting it.
ps: post your code!