Results 1 to 2 of 2

Thread: undefined reference for dcmtk libraries

  1. #1
    Join Date
    Feb 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default undefined reference for dcmtk libraries

    I'm trying to link dcmtk libraries for developing application for DICOM images. However, I cannot link those external libraries - I get the error message:

    C:\Users\Donn\Documents\untitled1\main.cpp:10: error: undefined reference to `DicomImage:icomImage(char const*, unsigned long, unsigned long, unsigned long)'
    main.cpp:

    Qt Code:
    1. #include "dcmtk/config/osconfig.h"
    2. #include "dcmtk/dcmdata/dctk.h"
    3. #include "dcmtk/dcmimgle/dcmimage.h"
    4. #include "iostream"
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8.  
    9. DicomImage *image = new DicomImage("test.dcm");
    10. if (image != NULL){
    11. std::cout << "hell yeah!";
    12. }
    13.  
    14. return 0;
    15. }
    To copy to clipboard, switch view to plain text mode 

    .pro file:

    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2016-02-18T19:16:51
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8.  
    9. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    10.  
    11. TARGET = untitled1
    12. TEMPLATE = app
    13.  
    14. SOURCES += main.cpp
    15.  
    16. #--------------------------------
    17. CONFIG += c++11
    18. #--------------------------------
    19. INCLUDEPATH += C:/DCMTK/include
    20.  
    21. LIBS += -L"C:/DCMTK/lib" -lAdvAPI32 -ldcmimgle -ldcmdata -loflog -lofstd -lWS2_32 -lNetAPI32 -lWSock32
    22.  
    23. #----------------------------------
    To copy to clipboard, switch view to plain text mode 

    How to fix this problem? I even tried to delete the LIBS line and still I get the same effect. Looks like those libraries are not linked at all.

  2. #2
    Join Date
    May 2018
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: undefined reference for dcmtk libraries

    I am too facing the same problem. Can somebody suggest a method to solve the error:
    The error is:
    error: undefined reference to `DicomImage:icomImage(char const*, unsigned long, unsigned long, unsigned long)'

Similar Threads

  1. Replies: 1
    Last Post: 15th January 2014, 09:14
  2. undefined reference
    By deepakswaroop in forum Newbie
    Replies: 1
    Last Post: 2nd March 2011, 07:46
  3. Undefined reference
    By eekhoorn12 in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2011, 16:45
  4. Undefined Reference to q libraries
    By powerserg in forum Newbie
    Replies: 2
    Last Post: 11th August 2010, 17:26
  5. undefined reference to fftw libraries
    By kmyadam in forum General Programming
    Replies: 2
    Last Post: 9th March 2006, 02:01

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.