0

I have installed SimpleITK and tested with ctest successfully. Then, I included the library in .bashrc as export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/softwares/vtk-itk/SimpleITK-build/lib. For installation, I ran make install in ~/softwares/vtk-itk/SimpleITK-build/SimpleITK-build and it was successfully installed. However, when I am trying to include #include <SimpleITK.h>, it seems that does know the installation path.

enter image description here

I am trying to write my code in Clion IDE, and even it does not show the simpleITK folder in External Library roots of the project.

How to resolve this issue?

S.EB
  • 1,966
  • 4
  • 29
  • 54

1 Answers1

0

I believe the problem is not related to LD_LIBRARY_PATH as this is not a linking issue. You can learn more how to change/add include paths in CLion or with cmake from:

https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html?_ga=2.94689947.663182776.1566473811-565224727.1566473811#include

Including directories in Clion

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206608335-How-can-I-specify-additional-include-files-

Basically it might be a missing include_directories( ) or something. I am not that familiar with simpleitk much but hope this general info helps.

life_steal
  • 55
  • 7
  • Thanks for your reply, I added `include_directories(/home/esomayeh/softwares/vtk-itk/SimpleITK-build/include/SimpleITK-1.1/)`, which has the header files inside to Cmake file. However, it is showing error: `main.cpp:(.text.startup+0xb4): undefined reference to `itk::simple::Image::Image....` for example here class `Image`. This error is shown for all the classes in the [helloWorld.cpp](https://simpleitk.readthedocs.io/en/master/Examples/HelloWorld/Documentation.html) , what is reason? how to resolve it – S.EB Aug 25 '19 at 12:59
  • I believe that is a linking error, which could be because you have not specified the linking paths. You can use target_link_libraries to add the path where SimpleITK has their libraries( *.so,*.a files, usually in a subfolder named lib ). Here is a good answer that might help you https://stackoverflow.com/questions/39598323/how-to-properly-link-libraries-with-cmake – life_steal Aug 26 '19 at 06:51