Hello,
I have a rather simple question which I can't solve on my own because I'm still a rookie
Anyway, I have my main application (main.exe) and a module.dll. My application has an AbstractModule class for custom modules and the module.dll uses this.
AbstractModule.h
//.h
class AbstractModule
{
public:
bool isSomething() const;
};
//.cpp
bool AbstractModule::isSomething()
{
return true;
}
//.h
class AbstractModule
{
public:
virtual QString name() const = 0;
bool isSomething() const;
};
//.cpp
bool AbstractModule::isSomething()
{
return true;
}
To copy to clipboard, switch view to plain text mode
Now I create a separate module dll for the first module ("module.dll") and it uses the "abstractmodule.h":
//.h
#include <abstractmodule.h>
class Module : public AbstractModule
{
public:
Module();
};
//.cpp
Module::Module()
{
bool isIt = this->isSomething(); //Link error (LNK2019)
}
{
return "Test";
}
//.h
#include <abstractmodule.h>
class Module : public AbstractModule
{
public:
Module();
QString name() const;
};
//.cpp
Module::Module()
{
bool isIt = this->isSomething(); //Link error (LNK2019)
}
QString Module::name() const
{
return "Test";
}
To copy to clipboard, switch view to plain text mode
In Visual Studio I set the "module.dll"-project to be dependent on the "main.exe"-project.
But when I try to compile the solution I get a link error:
error LNK2019: unresolved external symbol [...]
I guess it has somehow to do with the fact that the definition of AbstractModule::isSomething() is in the .exe?
I'm sorry, but I'm totally new to this whole dll stuff
Thank you for your help.
Bookmarks