PDA

View Full Version : Dll linking problem



Skizmo
7th February 2008, 22:04
Hi,

I'm trying to create a dll. The project compiles fine, it's the creating of the dll itself that goes wrong.

this is my .pro file


TEMPLATE = lib
TARGET =
DEPENDPATH += . Debug Release
INCLUDEPATH += .
CONFIG += dll

# Input
HEADERS += Buffer.h Client.h CommClient.h LibMain.h LList.h Thread.h
SOURCES += Buffer.cpp Client.cpp CommClient.cpp LList.cpp Thread.cpp

I have to compile/link it in 2 steps. The first time without the CONFIG option, and the second time with the CONFIG option.

If I do it with the CONFIG option the first time, I get these kind of errors.


release\Buffer.o(.text+0x269):Buffer.cpp: undefined reference to `_imp___ZN7QString11shared_nullE'
release\Buffer.o(.text+0x2e4):Buffer.cpp: undefined reference to `_imp___ZN7QString9fromAsciiEPKci'
release\Buffer.o(.text+0x2fb):Buffer.cpp: undefined reference to `_imp___ZN7QStringaSERKS_'
release\Buffer.o(.text+0x374):Buffer.cpp: undefined reference to `_imp___ZN7QString9fromAsciiEPKci'
release\Buffer.o(.text+0x396):Buffer.cpp: undefined reference to `_imp___ZN7QStringaSERKS_'
release\Buffer.o(.text+0x3c6):Buffer.cpp: undefined reference to `_imp___ZN7QString4freeEPNS_4DataE'
release\Buffer.o(.text+0x438):Buffer.cpp: undefined reference to `_imp___ZN7QString4freeEPNS_4DataE'
etc. .. (lots of them)

Anyone got some insight on this ?

jpn
8th February 2008, 07:40
Perhaps it a problem with missing exports/imports? You should export when building the lib and import when using the lib. Try searching the forums for "Q_DECL_EXPORT" and "Q_DECL_IMPORT".

Skizmo
8th February 2008, 09:56
Hmm. . ok I will look into that. (thanx for adding the tags to my post :) )