Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, May 2007
[OT] RE: Where is the import library for this build?


Message 1 in thread

Sorry for the OT but did the linker even warn you?  It seems kind of
silly to build a DLL with no exported functions and not at least get
warned.

-----Original Message-----
From: Michael Simpson [mailto:michaelsimpson@xxxxxxx] 
Sent: Wednesday, May 16, 2007 11:19
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Where is the import library for this build?


Staticlib will create a .lib.  But, when you create a .dll under  
windows, the compiler creates a .lib file which contains the stubs to  
the dll.  The application links to that .lib which uses the dll.  The  
alternative is to use LoadLibrary.

The reason that it was not working for me is because I did not define  
the export macro.  Nothing was being exported so Visual Studio was  
just being efficient.  As soon as I defined it, VS saw that there  
were exported functions and created the export library for me.

Thanks for the look.

M


On May 16, 2007, at 11:07 AM, Gordon.Schumacher@xxxxxxxxxxx wrote:

> Michael Simpson <michaelsimpson@xxxxxxx> wrote on 05/16/2007  
> 11:54:39 AM:
>
> # Platform: Windows, MSVC 2005
> # QT Version: 4.3.0 commercial
> # OS: XP
> #
> # In my .pro file,
> #
> # -------------------------------
> # TEMPLATE = lib
> # DEPENDPATH += src
> # INCLUDEPATH += src
> # TARGET = foo
> # CONFIG += dll
> #
> # include(src/foo.pri)
>
> Try TEMPLATE = staticlib; what you are building here is a dynamic  
> library
> (AKA .dll).
>

--
 [ signature omitted ] 

Message 2 in thread

LOL!  No.

Actually, if you think about it, you could load the dll  
using ::LoadLibrary, create pointers to functions and call into the  
dll that way.  That is what the import stub is doing for you.  My  
preference is why do that work if the linker will do that for you.   
If you are writing plugins, then of course, QLibrary does that work  
for you.

M

On May 16, 2007, at 12:02 PM, Jones, Torrin A (US SSA) wrote:

> Sorry for the OT but did the linker even warn you?  It seems kind of
> silly to build a DLL with no exported functions and not at least get
> warned.
>
> -----Original Message-----
> From: Michael Simpson [mailto:michaelsimpson@xxxxxxx]
> Sent: Wednesday, May 16, 2007 11:19
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Where is the import library for this build?
>
>
> Staticlib will create a .lib.  But, when you create a .dll under
> windows, the compiler creates a .lib file which contains the stubs to
> the dll.  The application links to that .lib which uses the dll.  The
> alternative is to use LoadLibrary.
>
> The reason that it was not working for me is because I did not define
> the export macro.  Nothing was being exported so Visual Studio was
> just being efficient.  As soon as I defined it, VS saw that there
> were exported functions and created the export library for me.
>
> Thanks for the look.
>
> M
>
>
> On May 16, 2007, at 11:07 AM, Gordon.Schumacher@xxxxxxxxxxx wrote:
>
>> Michael Simpson <michaelsimpson@xxxxxxx> wrote on 05/16/2007
>> 11:54:39 AM:
>>
>> # Platform: Windows, MSVC 2005
>> # QT Version: 4.3.0 commercial
>> # OS: XP
>> #
>> # In my .pro file,
>> #
>> # -------------------------------
>> # TEMPLATE = lib
>> # DEPENDPATH += src
>> # INCLUDEPATH += src
>> # TARGET = foo
>> # CONFIG += dll
>> #
>> # include(src/foo.pri)
>>
>> Try TEMPLATE = staticlib; what you are building here is a dynamic
>> library
>> (AKA .dll).
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ]