Results 1 to 7 of 7

Thread: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

  1. #1
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    I'm using Qt Creator 2.4.1 under Xubuntu 11.10.

    I've installed libgdcm2-dev (2.0.17) in repositories.

    Now I have

    /usr/include/gdcm-2.0
    /usr/lib/gdcm-2.0
    and a lot of *.so related to gdcm in
    /usr/lib/
    Writing code, I can autocomplete sentences with gdcm classes and functions (the IDE finds them), but compiling, it gives me error messages like:

    My code:

    Qt Code:
    1. #include <gdcmImageReader.h>
    2. ...
    3. gdcm::ImageReader ir;
    To copy to clipboard, switch view to plain text mode 
    I get:

    error: undefined reference to `gdcm::ImageReader::ImageReader()'
    I've tried with:

    Qt Code:
    1. #include "/usr/include/gdcm-2.0/ImageImageReader.h"
    To copy to clipboard, switch view to plain text mode 

    With this one, it works from a simple editor like Geany.

    In my .pro file I have

    Qt Code:
    1. INCLUDEPATH += /usr/include/gdcm-2.0
    2. LIBS += -L/usr/lib/
    To copy to clipboard, switch view to plain text mode 

    What could I try? Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    LIBS += -lgdcm
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    :-1: error: cannot find -lgdcm
    That's what I get with the line

    LIBS += -lgdcm

    I had it commented. So I guess I've already tried before. I really don't know what to do.

    It works with a simple editor, so I suppose it is a problem with Qt Creator, in the .pro file.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    What does the following return?

    ls /usr/lib/lib*gdcm*.so
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    nimoleo (3rd April 2012)

  6. #5
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    /usr/lib/libgdcmcharls.so /usr/lib/libgdcmjpeg12.so
    /usr/lib/libgdcmCommon.so /usr/lib/libgdcmjpeg16.so
    /usr/lib/libgdcmDICT.so /usr/lib/libgdcmjpeg8.so
    /usr/lib/libgdcmDSED.so /usr/lib/libgdcmMSFF.so
    /usr/lib/libgdcmIOD.so /usr/lib/libgdcmopenjpeg.so

    You gave me the idea of adding

    LIBS += -lgdcmcharls -lgdcmjpeg12 -lgdcmCommon -lgdcmjpeg16 -lgdcmDICT -lgdcmjpeg8 -lgdcmDSED -lgdcmMSFF -lgdcmIOD -lgdcmopenjpeg
    and it worked!

    Thank you very much.

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    Does the following return anything?

    pkg-config --list-all|grep gdcm

    If so, better use pkgconfig support built into qmake to set the libraries.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #7
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Creator + gdcm (Grassroots DICOM): can't link libraries?

    pkg-config --list-all|grep gdcm
    doesn't return anything.

Similar Threads

  1. Replies: 0
    Last Post: 17th January 2011, 09:14
  2. How to link static libraries --- in .pro file settings?
    By jiapei100 in forum Qt Programming
    Replies: 1
    Last Post: 7th January 2010, 16:39
  3. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52
  4. Dynamic link libraries
    By nareshqt in forum Qt Programming
    Replies: 6
    Last Post: 22nd April 2008, 06:20
  5. Replies: 2
    Last Post: 30th September 2007, 21:23

Tags for this Thread

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.