0

I am trying to use Qwt in one of my Qt DLLs.

The thing is that the library does not load if I call a constructor of QwtPlot inside. If I comment it out it loads. Just to note that DLL builds successfully when QwtPlot is uncommented.

I am using Visual Studio 2010.

Any thoughts?

EDIT (code that loads the dll, though the code works just fine for the dll which does not have QWT inside):

typedef bool (*EntryPointPtr)(); 
HINSTANCE _pDLL; 
EntryPointPtr _pFn; 
_pDLL = ::LoadLibrary("..\\MyDll.dll"); 
_pFn = (EntryPointPtr) ::GetProcAddress(_pDLL, "qtLoader");
_pFn();
4

1 に答える 1

3

Problem solved and here is the solution for anyone who might encounter the same problem again.

Initially I set up the project settings as follows:

  1. VC++ Directories -> Include Directories -> path to QWT src folder
  2. VC++ Directories -> Library Directories -> path to QWT lib folder
  3. Linker -> Input -> Additional dependencies -> qwtd.lib or qwt.lib (according to debug mode)

What needed to be done is:

  1. C/C++ -> General -> Additional include directories -> path to QWT src folder
  2. Linker -> General -> Additional library directories -> path to QWT lib folder
  3. Linker -> Input -> Additional dependencies -> qwtd.lib or qwt.lib (according to debug mode)

Seems like Visual Studio could not link it properly using the initial option.

PS. Thanks for helping. Your answers guided me in the right direction and eventually helped me to figure out what the problem was. Respect to you all.

于 2012-03-06T09:27:57.310 に答える