Results 1 to 2 of 2

Thread: Using static libs (*.a) in pro file

  1. #1
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4

    Default Using static libs (*.a) in pro file

    Hi,
    I have Qt project where I'm using ImageMagick. My pro file looks like this:

    CONFIG += qt
    QT += opengl
    INCLUDEPATH += /usr/local/include/ImageMagick/
    HEADERS += /usr/local/include/ImageMagick/Magick++.h
    HEADERS += ...
    LIBS += /usr/local/lib/libMagick++.so
    LIBS += /usr/local/lib/libMagickWand.so
    LIBS += /usr/local/lib/libMagickCore.so
    SOURCES += ...

    I do qmake and then make. Everything compiles flawlessly. I want to link my application with static Image magick libs so I don't have to distribute them with app. I change pro file to this:

    CONFIG += qt
    QT += opengl
    INCLUDEPATH += /usr/local/include/ImageMagick/
    HEADERS += /usr/local/include/ImageMagick/Magick++.h
    HEADERS += ...
    LIBS += /usr/local/lib/libMagick++.a
    LIBS += /usr/local/lib/libMagickWand.a
    LIBS += /usr/local/lib/libMagickCore.a
    SOURCES += ...

    Now I'm getting lots of errors during linking. Here are some of them:

    /usr/local/lib/libMagickCore.a(magick_libMagickCore_la-accelerate.o): In function `BindConvolveParameters':
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:337: undefined reference to `clCreateBuffer'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:343: undefined reference to `clCreateBuffer'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:349: undefined reference to `clCreateBuffer'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:359: undefined reference to `clSetKernelArg'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:363: undefined reference to `clSetKernelArg'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:368: undefined reference to `clSetKernelArg'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:373: undefined reference to `clSetKernelArg'
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:378: undefined reference to `clSetKernelArg'
    /usr/local/lib/libMagickCore.a(magick_libMagickCore_la-accelerate.o):/opt/ImageMagick-6.6.4-5/magick/accelerate.c:382: more undefined references to `clSetKernelArg' follow
    /usr/local/lib/libMagickCore.a(magick_libMagickCore_la-accelerate.o): In function `BindConvolveParameters':
    /opt/ImageMagick-6.6.4-5/magick/accelerate.c:386: undefined reference to `clFinish'
    /usr/local/lib/libMagickCore.a(magick_libMagickCore_la-tiff.o): In function `WriteTIFFImage':
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2522: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2801: undefined reference to `TIFFScanlineSize'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2950: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2952: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2956: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2943: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2946: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2762: undefined reference to `TIFFGetFieldDefaulted'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2764: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2765: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2798: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2782: undefined reference to `TIFFSetField'
    /opt/ImageMagick-6.6.4-5/coders/tiff.c:2634: undefined reference to `TIFFSetField'


    Is this right way to add static libs or problem is somewhere else? How to link with *.a libs? Qt itself is compiled as shared.
    Last edited by lechoo; 30th September 2010 at 12:24.

  2. #2
    Join Date
    Jul 2010
    Location
    France
    Posts
    18
    Thanks
    2
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Using static libs (*.a) in pro file

    I'm not sure but it might be :
    Qt Code:
    1. LIBS += /usr/local/lib/ -lMagick++ -lMagickWand -lMagickCore
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Static Link 3rd party libs
    By ^NyAw^ in forum General Programming
    Replies: 1
    Last Post: 13th July 2010, 19:10
  2. Cannot Build Static Libs On OS X
    By shenakan in forum Newbie
    Replies: 0
    Last Post: 22nd October 2009, 19:30
  3. Cannot Build Static Libs On OS X Due To Assistant.app
    By jasonk in forum Installation and Deployment
    Replies: 3
    Last Post: 9th October 2009, 19:00
  4. Static libs Libtidy on QT4 clean html/xml
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 29th May 2006, 17:28
  5. Qt libs static and dynamic
    By conexion2000 in forum Installation and Deployment
    Replies: 3
    Last Post: 24th May 2006, 09:09

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.