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

Qt-interest Archive, May 2007
Where is the import library for this build?


Message 1 in thread

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)

-------------------------------

I run qmake and then nmake.

It creates a debug and a release version.

In the debug directory, it creates foo.dll, foo.ilk, foo.pdb and  
foo.prl.

Where is the import library?  I expect a foo.lib to be created so  
that I may link it in another program.  What am I doing wrong?

Michael




Message 2 in thread

Got it!

I needed to add:

DEFINES += FOO_EXPORTS

Michael

On May 16, 2007, at 10:54 AM, Michael Simpson wrote:

> 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)
>
> -------------------------------
>
> I run qmake and then nmake.
>
> It creates a debug and a release version.
>
> In the debug directory, it creates foo.dll, foo.ilk, foo.pdb and  
> foo.prl.
>
> Where is the import library?  I expect a foo.lib to be created so  
> that I may link it in another program.  What am I doing wrong?
>
> Michael
>
>
>


Message 3 in thread

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 4 in thread

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 ]