[Qt-interest] Re : Re : Re : how to set dll path
Vincent Cai
wcai at cypress.com
Tue Sep 20 17:00:55 CEST 2011
为项目MapViewer执行构建步骤 ...
配置没有改变, 跳过 qmake 步骤.
正在启动 "D:\QtSDK\mingw\bin\mingw32-make.exe"
D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/wcai_perforce/LTS_R3/CFT members/WCAI/Projects/TSA/Qt/MapViewer-build-desktop'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore" -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui" -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include" -I"..\MapViewer\Gen4_src" -I"..\MapViewer\DataViewer" -I"..\MapViewer\qserialdevice" -I"..\MapViewer\qserialdevice\qabstractserial" -I"..\MapViewer\qserialdevice\qserialdeviceenumerator" -I"..\..\CPU\X86\GNU" -I"..\..\App" -I"..\..\Panel" -I"..\MapViewer\TSA\TSAConfig" -I"..\TSA\Gen4\Gen4TSA" -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include\ActiveQt" -I"debug" -I"." -I"..\MapViewer" -I"." -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\mkspecs\win32-g++" -o debug\main.o ..\MapViewer\DataViewer\main.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\MapViewer.exe object_script.MapViewer.Debug -L"d:\QtSDK\Desktop\Qt\4.7.3\mingw\lib" -lmingw32 -lqtmaind "E:/wcai_perforce/LTS_R3/CFT members/WCAI/Projects/TSA/Qt/TSA-build-desktop/Gen4/Gen4TSA/debug/Gen4TSA.dll" -lsetupapi -luuid -ladvapi32 -Ld:\QtSDK\Desktop\Qt\4.7.3\mingw\lib -lmingw32 -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib
mingw32-make[1]: Leaving directory `E:/wcai_perforce/LTS_R3/CFT members/WCAI/Projects/TSA/Qt/MapViewer-build-desktop'
./debug\main.o: In function `Z5qMainiPPc':
E:\wcai_perforce\LTS_R3\CFT members\WCAI\Projects\TSA\Qt\MapViewer-build-desktop/../MapViewer/DataViewer/main.cpp:24: undefined reference to `CentroidFinger_Start'
E:\wcai_perforce\LTS_R3\CFT members\WCAI\Projects\TSA\Qt\MapViewer-build-desktop/../MapViewer/DataViewer/main.cpp:26: undefined reference to `FingerID_motionFlag'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\MapViewer.exe] Error 1
mingw32-make: *** [debug] Error 2
进程"D:\QtSDK\mingw\bin\mingw32-make.exe"退出,退出代码 2 。
构建项目MapViewer 时发生错误 (目标: 桌面)
当执行构建步骤 'Make'时
It is linking error, can’t find the symbols.
But I can find the C++ symbol in the same dll.
From: qt-interest-bounces+wcai=cypress.com at qt.nokia.com [mailto:qt-interest-bounces+wcai=cypress.com at qt.nokia.com] On Behalf Of BOUCARD Olivier
Sent: 2011年9月20日 22:54
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] Re : Re : Re : how to set dll path
What kind of error did you get? Compiler? Linker? Execution?
Any, error log?
We can find a solution, but we can't guess an error... :)
________________________________
De : Vincent Cai <wcai at cypress.com>
À : BOUCARD Olivier <boucard_olivier at yahoo.fr>; "qt-interest at qt.nokia.com" <qt-interest at qt.nokia.com>
Envoyé le : Mardi 20 Septembre 2011 16h42
Objet : RE: [Qt-interest] Re : Re : how to set dll path
Thanks.
I have tried your method, but fail to access any variable or function except the MACRO definitions.
From: qt-interest-bounces+wcai=cypress.com at qt.nokia.com [mailto:qt-interest-bounces+wcai=cypress.com at qt.nokia.com] On Behalf Of BOUCARD Olivier
Sent: 2011年9月20日 22:22
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] Re : Re : how to set dll path
Under Windows only symbols, usually classes, decorated with __declspec(dllexport) are available from outside world.
For C, is different. just put the headers of the C library between extern "C"{}.
________________________________
De : Vincent Cai <wcai at cypress.com>
À : BOUCARD Olivier <boucard_olivier at yahoo.fr>; "qt-interest at qt.nokia.com" <qt-interest at qt.nokia.com>
Envoyé le : Mardi 20 Septembre 2011 16h06
Objet : RE: [Qt-interest] Re : how to set dll path
One more question:
I think the dll with C++ language and created by Qt has exported all the members to application.
But I have a dll which is created with pure C language and gcc compiler.
I don’t know how to access the global variables and interface in the dll.
Is there any document talking about this topic?
Thanks.
From: qt-interest-bounces+wcai=cypress.com at qt.nokia.com [mailto:qt-interest-bounces+wcai=cypress.com at qt.nokia.com] On Behalf Of Vincent Cai
Sent: 2011年9月20日 22:01
To: BOUCARD Olivier; qt-interest at qt.nokia.com
Subject: Re: [Qt-interest] Re : how to set dll path
Thanks for your reply and I got the answer.
But I am a little confused that why you said that ‘The libraries are loaded before the execution start.’.
Isn’t a dll loaded only when requested?
From: qt-interest-bounces+wcai=cypress.com at qt.nokia.com [mailto:qt-interest-bounces+wcai=cypress.com at qt.nokia.com] On Behalf Of BOUCARD Olivier
Sent: 2011年9月20日 21:12
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] Re : how to set dll path
Jeremy is right. Setting the library path in the code can't help. It is too late. The libraries are loaded before the execution start.
Under Windows, if you do not want to move your dll you have to add your dll directory to the PATH environment variable.
Please take a look at http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx#search_order_for_desktop_applications.
________________________________
De : Jeremy Lainé <jeremy.laine at bolloretelecom.eu>
À : qt-interest at qt.nokia.com
Envoyé le : Mardi 20 Septembre 2011 14h58
Objet : Re: [Qt-interest] how to set dll path
Le Sep 20, 2011 à 1:00 PM, Vincent Cai a écrit :
> Dear all,
>
> I am newbie with QT. :)
> Current, I am trying to create an application with external dll.
> I can create dll successfully.
> And if I copy the dll to the application directory, the application can load dll and run correctly.
>
Unless you are talking about a plugin, to my knowledge no Qt code can help you here : the application will simply not run as the links to the library cannot be resolved.
You can try adding the directory which contains the DLL to the PATH environment variable though.
--
Jeremy LAINE
Bolloré telecom | 11bis, rue Scribe | F-75009 Paris
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com<mailto:Qt-interest at qt.nokia.com>
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
________________________________
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
________________________________
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
________________________________
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
________________________________
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110920/a8101f5b/attachment.html
More information about the Qt-interest-old
mailing list