2

I am new to working with Qt in windows environment and I am facing issues in linking dynamic libraries for the project.

I built boost and quantlib as dynamic libraries and included in the project, but the application is throwing the error:" LNK1104: cannot open file 'QuantLib-vc141-mt.lib'"

Here is my .pro file,

INCLUDEPATH += "C:/Users/som/Desktop/boost_1_68_0"  \#Boost
               "C:/Users/som/Desktop/QuantLib-master" #Quantlib

LIBS += -LC:/Users/som/Desktop/QuantLib-master/lib/ #QuantLib
LIBS += -LC:/Users/som/Desktop/boost_1_68_0/stage/lib/ #Boost
LIBS += -lQuantLib-vc141-mt
LIBS += -lboost_date_time-vc141-mt-x32-1_68

The quantlib library directory contains QuantLib-vc141-mt.dll and lQuantLib-vc141-mt-gd.dll files.

Som
  • 185
  • 15
  • Is the -l probably for static linking .lib files? I do not use dynamic linking but found: LIBS += "$$PWD/myLibrary/mylibrary.dll" under https://wiki.qt.io/How_to_link_to_a_dll – Jan Win Aug 13 '18 at 15:13
  • I think either way is right. I tried the method pointed by you but I am getting the same error. The thing with static linking is that as my application is quite big it takes a lot of time for compiling . – Som Aug 13 '18 at 15:18
  • The Error states, that it could not find the .LIB files, but you got .DLL files, so there needs to be a difference, in your example you do not use an extension and the linker assumes .lib files. – Jan Win Aug 13 '18 at 15:36
  • Also in this old Question the answer states, that you need additionally a .lib with the symbols and the dll for loading dynamically. https://stackoverflow.com/questions/12326401/qt-specify-dll-path-in-pro-file – Jan Win Aug 13 '18 at 15:44
  • thanks I am rebuilding the libs I will check once it gets done. – Som Aug 13 '18 at 15:50

0 Answers0