• 11509阅读
  • 7回复

qt opensource 4.5.1 sdk can not found some libs? [复制链接]

上一主题 下一主题
离线csoapy
 

只看楼主 正序阅读 楼主  发表于: 2009-05-30

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!
离线xn007
只看该作者 7楼 发表于: 2009-11-23
有人,有人直接用。 qextserialport-1.2-win-alpha 的 cpp 和 h 文件写的串口调试工具。是可以用的。我就按你的思维。改成功了。
别搞啥DLL Lib文件了。我搞了2天头都大了。搞不定。

后来发现。qextserialport-1.2-win-alpha  例子里面都是用#include <xxxx.h> 的方式调用的。后来稍作修改你的程序也可以了。qextserialport-1.2-win-alpha 先在命令行生成pro文件,按照例子稍作修改,生成2个文件,把必要的。cpp  。h 文件放入文件夹。在qtcreator中编码改为system 后编译成功。
里面的例子都成功的。要用debug方式编译。
[ 此帖被xn007在2009-11-24 08:45重新编辑 ]
离线xn007
只看该作者 6楼 发表于: 2009-11-23
qt-sdk-win-opensource-2009.03 在哪里下。、
qt-sdk-win-opensource-2009.04 不能生成lib
命令行下可以。但在Vs+2005Qt商业版本中报错
QextSerialPort.lib(qextserialenumerator.obj) : error LNK2001

qt真头痛。换个版本就出问题。
离线minicool
只看该作者 5楼 发表于: 2009-07-11
我也尝试过 确实编译不过去 ,可是换了qt-sdk-win-opensource-2009.03以后好像就可以了。
离线csoapy

只看该作者 4楼 发表于: 2009-06-02
引用第3楼shiroki于2009-06-01 10:42发表的  :
How did you compile the libqextserialport.a? And could you please paste the build output before the error message(including the compilation command line)?


just i run qmake and then mingw32-make, and there is no error after compiling.



mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/dev/Qt/2009.02/qt/src/3rdparty/qextserialport-1.2win-alpha'
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\qextserialbase.o qextserialbase.cpp
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\qextserialport.o qextserialport.cpp
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\qextserialenumerator.o qextserialenumerator.cpp
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\win_qextserialport.o win_qextserialport.cpp
d:/dev/Qt/2009.02/qt/bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 qextserialbase.h -o build\moc\moc_qextserialbase.cpp
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\moc_qextserialbase.o build\moc\moc_qextserialbase.cpp
d:/dev/Qt/2009.02/qt/bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 qextserialport.h -o build\moc\moc_qextserialport.cpp
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\moc_qextserialport.o build\moc\moc_qextserialport.cpp
d:/dev/Qt/2009.02/qt/bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 win_qextserialport.h -o build\moc\moc_win_qextserialport.cpp
g++ -c -g -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DLL -DQT_CORE_LIB -I"..\..\..\include\QtCore" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"build\moc" -I"." -I"..\..\..\mkspecs\win32-g++" -o build\obj\moc_win_qextserialport.o build\moc\moc_win_qextserialport.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -shared -mthreads -Wl -Wl,--out-implib,build\libqextserialportd.a -o build\qextserialportd.dll build/obj/qextserialbase.o build/obj/qextserialport.o build/obj/qextserialenumerator.o build/obj/win_qextserialport.o build/obj/moc_qextserialbase.o build/obj/moc_qextserialport.o build/obj/moc_win_qextserialport.o  -L"d:\dev\Qt\2009.02\qt\lib" -lsetupapi -lQtCored4
mingw32-make[1]: Leaving directory `D:/dev/Qt/2009.02/qt/src/3rdparty/qextserialport-1.2win-alpha'

creating library file: build\libqextserialportd.a
[ 此帖被csoapy在2009-06-02 10:52重新编辑 ]
离线shiroki

只看该作者 3楼 发表于: 2009-06-01
How did you compile the libqextserialport.a? And could you please paste the build output before the error message(including the compilation command line)?
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
离线robertkun

只看该作者 2楼 发表于: 2009-06-01
引用第1楼rqzrqh于2009-05-30 20:48发表的  :
四级没过,悲剧了


化悲痛为力量。。
                                              简单的生活使人快乐!
离线rqzrqh

只看该作者 1楼 发表于: 2009-05-30
四级没过,悲剧了
快速回复
限100 字节
 
上一个 下一个