[Qt-interest] Re : how to set dll path

Vincent Cai wcai at cypress.com
Tue Sep 20 16:06:31 CEST 2011


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110920/e5e6a292/attachment.html 


More information about the Qt-interest-old mailing list