Results 1 to 3 of 3

Thread: Dll linking problem

  1. #1
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Dll linking problem

    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

    Qt Code:
    1. TEMPLATE = lib
    2. TARGET =
    3. DEPENDPATH += . Debug Release
    4. INCLUDEPATH += .
    5. CONFIG += dll
    6.  
    7. # Input
    8. HEADERS += Buffer.h Client.h CommClient.h LibMain.h LList.h Thread.h
    9. SOURCES += Buffer.cpp Client.cpp CommClient.cpp LList.cpp Thread.cpp
    To copy to clipboard, switch view to plain text mode 

    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 ?
    Last edited by jpn; 8th February 2008 at 07:37. Reason: reformatted to look better

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Dll linking problem

    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".
    J-P Nurmi

  3. #3
    Join Date
    Jun 2006
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dll linking problem

    Hmm. . ok I will look into that. (thanx for adding the tags to my post )

Similar Threads

  1. problem with order of libs during linking
    By minimax in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2008, 10:32
  2. Linking problem on Mac os x 10.4
    By maverick_pol in forum General Programming
    Replies: 0
    Last Post: 6th January 2008, 14:09
  3. why linking problem with QGLWidget???
    By Shuchi Agrawal in forum Newbie
    Replies: 17
    Last Post: 16th March 2007, 10:45
  4. Replies: 4
    Last Post: 20th February 2006, 09:11
  5. Runtime dynamic linking + Qt4 problem
    By _Ramirez_ in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2006, 14:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.