Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: linking libraries

  1. #21
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: linking libraries

    Right. Thanks again for the help! Youv'e saved me some days to finish a prototype of the project

    (I renamed file to dummy.cpp and used CXXFLAGS again in dummy.pro, then put extern "C" in dummy.cpp as you mentioned & recompiled)

  2. #22
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: linking libraries

    Ok, now to the next problem.. This should fit under the same topic.

    I want to build a static executable with this vortex library included. I have tried putting "static" in my "CONFIG +=" in my .pro file, but that just makes no difference. (same size of executable, and not working on other machine with same distro)

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: linking libraries

    Do you have a static version of that library?

  4. #24
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: linking libraries

    no, not that i know of.
    the library is compiled with --enable-static but I dont know where the static library is installed..

  5. #25
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: linking libraries

    If you don't have a static version of that library you can't link statically with it. Look for libvortex.a or something similar on your filesystem.

  6. The following user says thank you to jacek for this useful post:

    JustaStudent (20th April 2006)

  7. #26
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: linking libraries

    Found it!

    /usr/local/lib/libvortex.a

    how do i now compile my Qt project with this statically?

    (thanks for the help, btw! you seem to really know this stuff.)

  8. #27
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: linking libraries

    If you use pkg-config, then try changing --libs to --static.

  9. #28
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: linking libraries

    I changed the libs in project settings from "$$system(pkg-config --libs vortex)" to "--static $$system(pkg-config --libs vortex)"

    Now I get this error message;

    /usr/bin/ld: cannot find -lqt-mt

  10. #29
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: linking libraries

    Quote Originally Posted by JustaStudent
    Now I get this error message;

    /usr/bin/ld: cannot find -lqt-mt
    It looks like it tries to link statically with Qt.

    Try:
    -static $$system(pkg-config --libs vortex) -dy

  11. #30
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    3
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: linking libraries

    I tried the -dy switch, still the same. I want also Qt libraries to be static. I have /usr/local/qt/lib/libqt-mt.a already so that should be possible

Similar Threads

  1. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52
  2. problem with order of libs during linking
    By minimax in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2008, 10:32
  3. Qt 3.3 libraries
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st December 2006, 17:25
  4. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  5. Replies: 4
    Last Post: 7th March 2006, 08:52

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.