i tried to compile
qextserialport-1.2-win-alpha using qt-sdk-win-opensource-2009.02.1,but there is no setup*() functions in the libqextserialport.a file after compiling. because the qtcreator complain:
mingw32-make.exe[1]: Leaving directory `D:/work/MySerialPort'
D:\dev\Qt\2009.02\mingw\bin\mingw32-make.exe: Leaving directory `D:/work/MySerialPort'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x132):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiGetDeviceRegistryPropertyW@28'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x170):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiGetDeviceRegistryPropertyW@28'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x23a):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiGetClassDevsW@16'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x2af):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiEnumDeviceInterfaces@20'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x31f):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiGetDeviceInterfaceDetailW@24'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x375):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiGetDeviceInterfaceDetailW@24'
d:\dev\Qt\2009.02\qt\lib/libqextserialport.a(qextserialenumerator.o)(.text+0x5a8):qextserialenumerator.cpp: undefined reference to `_imp__SetupDiOpenDevRegKey@24'
collect2: ld returned 1 exit status
but there is a line "win32:LIBS += -lsetupapi" in qextserialport.pro and there is a file of libsetupapi.a in "D:\dev\Qt\2009.02\mingw\lib" which is my qt directory.
and there is a line "CONFIG += debug_and_release" in qextserialport.pro, but there is no libs of qextserialport in release version after compiling.
but if i added a new line "#pragma comment( lib, "Advapi32.lib" )" in the file "QextSerialEnumerator.h" in qextserialport, and then compiled qextserialport-1.2-win-alpha using qt 4.4.3 for vs2005,it works!
so there is must be an error in qt opensource 4.5.1 sdk, which cannot add functions which in the libsetupapi.a.
i was told that the format of libXXX.a using by mingw is the same to XXX.lib using by visual studio. so i renamed the static lib of "qextserialport.lib" which is generalised by qt4.4.3 for vs2005 into "libqextserialport.a", and copied it and the file of "qextserialport.prl" into directory of "D:\dev\Qt\2009.02\qt\lib", but it can not works!
how to compile qextserialport-1.2-win-alpha using qt opensource 4.5.1 sdk?
thanks for helping!