0

I am working on an xcode project that requires me to use ITK (a c++ library), I have went through with the installation of ITK, by doing

ccmake InsightToolkit-4.13.1 

and then configuring and generating the files, then runing

make make install 

but I do not know how to import the library into the xcode project, where I get the following error every time I try building it:

'itkImage.h' image file not found

enter image description here I would like to know how could I import it and share it with other people on different computers.

9
  • My advice is to use CMake to generate your project for your application. Commented Sep 9, 2018 at 18:50
  • But I already have a project and I would like to add this library to it Commented Sep 9, 2018 at 19:02
  • I understand that. It's just more difficult to do what you want to do. There is information in the itk wiki how to set this up. CMake generates code to setup the factories which you don't get when you don't use it. Commented Sep 9, 2018 at 19:11
  • 1
    Here is the info: itk.org/ITKExamples/src/IO/ImageBase/RegisterIOFactories/… Commented Sep 9, 2018 at 19:14
  • 1
    With that said your problem here is a lot more basic. You need to add the include folder for ITK to your compiler settings. Also you will have to add libraries to link to your linker settings. I can't tell you how to do that in xcode. Commented Sep 9, 2018 at 19:32

1 Answer 1

1

The #include directive comes with two flavors:

  • With quotes (#include "file.h")
  • With ankle brackets (#include <file.h>)

The first usually refers to files relative to your project directory. The second is for system libraries.

You can influence the search path in the project setting:

  • double-click on the project in the project explorer
  • Click on Build settings
  • Click on your target
  • Click on All to view also hidden options
  • In the section Search Paths you can then update the header search path to include the absolute path of you rlibrary headers. Attention: you have to do this for the Debug and for the Release builds:

enter image description here

This will solve the error that you have reported.

Remark: be careful, because after this is solved, you could experience some other issues related to the good use of the library, as pointed out by drescherjm in the comments (link about registration of custom classes to the library's fatories if Cmake is not used to compile the project)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.