In a fresh OF project(VS15), I successfully managed to create and access my class named person from an external definition. But I am having problems doing the same on the project I’ve been working in the past week. I know it’s a rather basic question, but I’ve spend a few hours without being able to figure out what I am missing, or if there is a conflict.
At the top of ofApp.h I have
The class is accessible in ofApp.cpp when I do this within the
person someone = person(); someone.draw();
But for some reason, declaring
person bob; inside class ofApp in ofApp.h gives me the following two errors even if person.h is included at the top of the same file.
Severity Code Description Project File Line Suppression State Error C3646 'bob': unknown override specifier (compiling source file src\person.cpp) we d:\mystuff\ch3\dev\visual studio 2015\of_v0.9.8_vs_release\apps\myapps\we\src\ofApp.h 90 Severity Code Description Project File Line Suppression State Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file src\person.cpp) we d:\mystuff\ch3\dev\visual studio 2015\of_v0.9.8_vs_release\apps\myapps\we\src\ofApp.h 90
How is it possible for person to be accessible in the .cpp file but not in the .h one?
I believe I am defining the class in the exact same way in the fresh project where it work. Is there a chance that the definition may be conflicting with other libraries?
The full source code is in gihub.