Environment is MSVC 2010 SP1Rel, Qt 4.8.1, Win 7x64 only
Approach 1 - Build .lib's and link against them, include headers.
Built libs using Qt creator after double clicking on qextserialport.pro. It then prompted me to configured my targets, which I did. Click on the hammer to build. In my c++ solution I included src as includes, and copied over freshly built .lib's to debug+release libs respectively. I then ensured these libs were linked against in the configuration properties (standard practice, we have lots of third-party stuff). Functions are not found when I try and link against them.
DeviceFramework.lib(MySerialClass.obj) : error LNK2019: unresolved external symbol "public: class QByteArray __cdecl QextSerialPort::readAll(void)" (?readAll@QextSerialPort@@QEAA?AVQByteArray@@XZ) referenced in function "public: void __cdecl MySerialClass::logAndPassData(void)" (?logAndPassData@MySerialClass@@QEAAXXZ)
3>DeviceFramework.lib(MySerialClass.obj) : error LNK2019: unresolved external symbol "public: __cdecl QextSerialPort::QextSerialPort(class QString const &,struct PortSettings const &,enum QextSerialPort::QueryMode,class QObject *)" (??0QextSerialPort@@QEAA@AEBVQString@@AEBUPortSettings@@W4QueryMode@0@PEAVQObject@@@Z) referenced in function "protected: virtual bool __cdecl MySerialClass::initialize(void)" (?initialize@MySerialClass@@MEAA_NXZ)
Approach 2 - Include sources in our project (already using Qt, so why not) then build and link against them in our project.
Moc'ing is successful, and then when building the compile complains about QextSerialPortPrivate not being defined. Please note that I have removed some PII From the paths below, but on my screen I can confirm they are correct :)
1> moc_qextserialenumerator.cpp
1> moc_qextserialport.cpp
1> moc_qextwineventnotifier_p.cpp
1> qextserialenumerator.cpp
1> qextserialenumerator_win.cpp
1> qextserialport.cpp
1> qextserialport_win.cpp
1> qextwineventnotifier_p.cpp
1>GeneratedFiles\Debug\moc_qextserialport.cpp(122): error C2027: use of undefined type 'QextSerialPortPrivate'
1> c:\users\USERNAME\SOMEPATH\framework\qextserialport\generatedfiles\debug\../../qextserialport.h(168) : see declaration of 'QextSerialPortPrivate'
1>GeneratedFiles\Debug\moc_qextserialport.cpp(122): error C2227: left of '->_q_onWinEvent' must point to class/struct/union/generic type
1>GeneratedFiles\Debug\moc_qextserialport.cpp(122): error C2061: syntax error : identifier 'HANDLE'
1>GeneratedFiles\Debug\moc_qextserialport.cpp(123): error C2027: use of undefined type 'QextSerialPortPrivate'
1> c:\users\USERNAME\SOMEPATH\framework\qextserialport\generatedfiles\debug\../../qextserialport.h(168) : see declaration of 'QextSerialPortPrivate'
1>GeneratedFiles\Debug\moc_qextserialport.cpp(123): error C2227: left of '->_q_canRead' must point to class/struct/union/generic type
1> The command exited with code 2.
1>Done executing task "CL" -- FAILED.
1>Done building target "ClCompile" in project "QextSerialPort.vcxproj" -- FAILED.
After some digging, QextSerialPortPrivate is forward declared in qextserialport.h, and then the header is defined in qextserialport_p.h. The implementation lies in qextserialport.cpp and somehow I think the compiler is getting confused.
Thoughts? (on either approach...) Approach 1 is greatly preferable for obvious reasons.