It is incredibly easy to accidentally make your Derived class' functions not properly override, by getting the signature wrong. Here's an example:
class Base
{
virtual void MyFunc() const;
};
class Derived : public Base
{
void MyFunc(); //<-- Won't override, because the 'const' is missing, so it's a different function entirely.
};
The more parameters, attributes, and long return variable names, the easier it is to accidentally mess the signatures up.
That's why, in C++11 and above, they added the 'override' keyword:
class Derived : public Base
{
void MyFunc() const override;
};
The override keyword enforces, at compile time, that the function signature actually matches.
(Unless you have multiple virtual functions with the same name that overload each other in the base class. If so, then you need to ban yourself from C++ and learn a more user-friendly language. :P)
Basically, anytime you ever say "virtual" in a Base class, you should now say "override" in a Derived class, and let the compiler catch your mistakes for you.
I'm not 100% sure this is your problem, but since it's the most common problem, it'd be item #1 to check. :)
The headers are all the same, they're actually all in the same folder of the exe project, I didn't have time to move them.
Well, actually, that should be your first fix. The headers for your library should belong with your library. There should almost never be two headers for the same class.
Your .exe is supposed to #include your library's header that owns the header.
Your Derived class' "Derived.h" header should #include "./MyLibrary/Base.h" - not a copy of it, but the exact same file that was used to compile the library.
Anything other than that is abnormal - not 100% always wrong, but 99.99% of the time wrong (no exaggeration; only about 1 out of 10,000 headers should do that, to give not un-reasonable estimate. Likely even fewer than that). In coding, 'abnormal' almost always means 'guilty until proven innocent'. :wink: