-
Class errors
I am getting errors like 'copyStr' was not declared in this scope.
To explain easier, I have what I'll call class a and class b. Both are in separate .cpp files. I am attempting to call a method from class b whilst in a method in class a that uses class b as a parameter. I will then get the error above.
-
The class a method needs to have visibility of the definition of class b. A forward declaration is not enough.
That is usually done by having a.cpp do an #include "b.h" where b.h declares class b (and its member functions). This #include must occur before the code that tries to call a member of class b.