I'm trying to create a dll that reads from a static library that I also wrote.So I have my dll and works fine but when the static library comes in it has problems. first if I add the header for the static library works fine but when I call any function for it it tells me that there is a link error "error LNK2019: unresolved external symbol "
The dll does not include the header of the static library directly, it is included in the interface of the dll, if I add it to the header of the dll I get the same results.
All classes in my static library have a __declspec (dllexport)
So its like this
//dllInterface.h
#include "staticlib.h"
class dllinterface
{
virtual funct1()=0;
virtual funct2()=0;
....
}
//mydll.h
class mydll:public dllinterface
{
funct1();
funct2();
...
}
//mydll.cpp
funct1()
{
callsomefunctionfromStaticLibrary();
}
funct2()
{
.....
}
Basically if I did not have the callsomefunctionfromStaticLibrary() call everything will compile with no errors, when I use anything from the library the compiler(msvs 2005) give me error LNK2019 for every function called from the static library.
Well its my first time making dlls so I'm pretty lost, I can tell you that if I include "staticlib.cpp" in my "mydll.cpp" everything compiles with no problems and the dll runs but I think something bad will happend later using this solution because I dont think that its correct to add a .cpp file into another cpp to fix the problem.
Thanks for your time.
Lars