Results 1 to 3 of 3

Thread: qmake: removing --no-undefined option for libs.

  1. #1
    Join Date
    Dec 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qmake: removing --no-undefined option for libs.

    I'm trying to build a library that includes some Qt4 bits, so I'm using qmake with the "TEMPLATE = lib" setting. The problem is, it automatically generates a --no-undefined option for the linker, as shown in this line from the Makefile:
    Qt Code:
    1. LFLAGS = -Wl,--no-undefined -shared -Wl,-soname,libdm.so.1
    To copy to clipboard, switch view to plain text mode 
    However, as I'm linking in some other libraries, it spits out a load of "undefined reference" errors. If I manually remove the "-Wl,--no-undefined" bit from the Makefile, it all builds and links fine.

    Is there a way of removing "--no-undefined" using the .pro file, rather than editing the generated Makefile?

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: qmake: removing --no-undefined option for libs.

    Edit the appropriate mkspec from Qt. You can find it in the mkspecs-directory of your Qt installation.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Dec 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: removing --no-undefined option for libs.

    That's done the trick. I editted "g++.conf" in "/usr/share/qt4/mkspecs/common", so the line containing "QMAKE_LFLAGS += -Wl,--no-undefined" was changed to remove the --no-undefined bit.

    Thanks for the help.

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 14:22
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  3. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 13:41
  4. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 14:28
  5. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15

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.