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

BOUCARD Olivier boucard_olivier at yahoo.fr
Tue Sep 20 16:11:23 CEST 2011


Sorry, my bad. What I tried to say is that the libraries are loaded before the main function is called.
When you compile a program against some dynamic library, you have to tell the compiler which one, right?
So your executable keep track on which libraries is linked against (see http://www.dependencywalker.com/).
So during the launch of an executable, Windows check those dependencies and load them, or do nothing if already present in memory.




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


More information about the Qt-interest-old mailing list