Results 1 to 11 of 11

Thread: [QtDcm] Library compile failure, why?

  1. #1
    Join Date
    Apr 2012
    Posts
    38
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question [QtDcm] Library compile failure, why?

    Hello everyone,

    I am trying to implement DICOM support in my Qt project, but I can't seem to be able to successfully compile the QtDcm library. Since this library is dependent on both DCMTK and ITK, they must be compiled first in order to get QtDcm.

    I can compile both DCMTK and ITK without a problem, however when it gets to QtDcm, I get compile errors coming from file QtDcmConvert.cpp line 24, #include <itkOrientedImage.h> - no such file or directory.

    I searched for the file and found it in \ITK\include\InsightToolkit\Common. What could I be missing?


    Thank you.


    Regards,
    Mr_Cloud


    Edit: Could this be a CMake-related error?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [QtDcm] Library compile failure, why?

    I searched for the file and found it in \ITK\include\InsightToolkit\Common. What could I be missing?
    Did you make sure this path is in the include search path of your QtDcm build?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2012
    Posts
    38
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QtDcm] Library compile failure, why?

    How would I do that, high_flyer? I've tried adding CMAKE_INCLUDE_PATH before generating the makefile, but the manually specified variable wasn't used in the project.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [QtDcm] Library compile failure, why?

    How would I do that, high_flyer?
    Look at the pro file?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Apr 2012
    Posts
    38
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QtDcm] Library compile failure, why?

    CMake doesn't generate pro files, only Makefile.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [QtDcm] Library compile failure, why?

    Isn't QtDcm a Qt project?
    If it is, it has a pro file.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Mar 2012
    Location
    India
    Posts
    102
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: [QtDcm] Library compile failure, why?

    Open the Makefile and add the INCLUDEPATH (\ITK\include\InsightToolkit\Common) in that variable. Run make after this.
    Do same for the other library whose dependency is there.

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: [QtDcm] Library compile failure, why?

    This might work, but if this is a Qt project on which qmake is calles to generate the makefile, the changes you make to the makefile will be overwritten by qmake the next time it is called.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    Mar 2012
    Location
    India
    Posts
    102
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: [QtDcm] Library compile failure, why?

    That's correct. But I thought as Mr_Cloud is compiling a library it will not be soon he needs to run qmake again.
    But I agree the correct approach would be to add the path in the INCLUDE variable in the pro file as soon as he finds one.

  10. #10
    Join Date
    Apr 2012
    Posts
    38
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QtDcm] Library compile failure, why?

    I got it working. High_flyer and Charvi, Cmake doesn't generate a pro file, only a Makefile. And QtDcm is available only as a CMake project. Therefore all the modifications must be done within CMake. And when I tried adding a custom includepath, it would ignore it.

    Anyway I got it to work. For future reference under windows, there are three things needed to get QtDcm compiled: DCMTK, ITK and libtiff.a in \mingw\lib. First, generate the proper files using CMake for both DCMTK and ITK, open cmd and hit make install. By default, it should output to Program Files (x86). Then, when generating QtDcm, it will ask for DCMTK folderpath, then ITK CMake config folderpath. Note, this is NOT the same path as the root of the install. Therefore, in the ITK_DIR, the correct folderpath is \ITK\lib\InsightToolkit. This should ensure you get the right dependencies.

    Finally, change build type to release for QtDcm, build shared libs, then make install. It should also output to Program Files.


    Thanks for your suggestions guys.


    Edit: The only problem I have now is that ui_qtdcm.h is not found when I #include <QtDcm.h>
    Edit 2: Found the ui files, but now I get undefined reference errors when I try to declare an instance of QtDcm. This is mildly frustrating.
    Last edited by Mr_Cloud; 12th July 2012 at 03:39.

  11. #11
    Join Date
    Apr 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [QtDcm] Library compile failure, why?

    neng jia yi xia 471921964

Similar Threads

  1. Plot failure
    By Olmasi in forum Qwt
    Replies: 0
    Last Post: 31st March 2011, 17:14
  2. QFileDialog failure
    By johnmauer in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2011, 10:00
  3. Compile Qt 4.6.2 to static library failed
    By kea_ in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2010, 20:53
  4. Qt/windows: how to compile program with audiere library
    By punjabikura in forum Qt Programming
    Replies: 3
    Last Post: 21st December 2009, 15:09
  5. QWT assert failure
    By Andimat in forum Qwt
    Replies: 1
    Last Post: 21st June 2007, 14:36

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.