Search code examples
c++windowsqtserial-portqextserialport

Qt QextSerialPort static lib


How do I make a static library of QextSerialPort for windows platform for use with Qt 4.8.5

I do not understand how to modify the .pro or .pri files to do this. (The .prf file keeps regenerating).

So I tried modifying the resultant .vcproj file to make a static build, and removed some of the defines, but I still get warnings like:

qextserialport.lib(qextserialport.obj) : warning LNK4006: "public: __thiscall QextSerialPort::QextSerialPort(class QString const &,enum QextSerialPort::QueryMode,class QObject *)" (??0QextSerialPort@@QAE@ABVQString@@W4QueryMode@0@PAVQObject@@@Z) already defined in qextserialportd1.lib(qextserialportd1.dll); second definition ignored

and at run time get "System Error: The program can't start because qextserailportd1.dll is missing from your computer". Which of course is true because I am trying to make a static build using a .lib

So how do I correctly do a static build?


Solution

  • Thanks Nejat for your response. Very clear.

    Also, for those following in my footsteps, it was a case of read-the-manual for me. The answer is in: https://code.google.com/p/qextserialport/wiki/QextSerialPort_1_2_RC

    It plainly says to add CONFIG += qesp_static

    to the .pro file. This works too.