Build HelloWorld error

(Yinpeter) #1

Build Env.:
MacOS: 10.13.6
Xcode: 10.1
ITK: ITK 5.0 Release Candidate 2

! Apple Mach-O Linder(id) Error
!Linker command failed with exit code 1(use -v to see invocation)

ld: library not found for -litkdouble-conversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can someone help me this?

(Matt McCormick) #2

Hello @yinpeter,

Did ITK build successfully and did the build complete? This error may be possible if the itkdouble-conversion library was not completely built.

(Yinpeter) #3

Hi Matt,

I have built ITK 5.0 completely with no error.
Attached, the “libitkdouble-conversion-5.0.a” is built well.

(Matt McCormick) #4

Can more details be provided on the process used to create the hello world?

(Yinpeter) #5


ITK 5.0:

  1. I use CMake to config/generate the ITK 5.0 Xcode project
  2. To Build library in Xcode with no error.


  1. Find the HelloWorld resource in ITK 5.0 directory.

  2. Use CMake to config/generate the Xcode project:
    —2.1 set the ITK_DIR to ITK 5.0 binary directory
    —2.2 config/generate the Xcode project

  3. Build the Xcode project with too many issue:
    —3.1Modify the CMakeLists.txt as Dzenanz suggested
    set(CMAKE_CXX_STANDARD 11) # Supported values are 11, 14, and 17.
    —3.2 rebuild the Xcode project
    —3.3 then face the error as I listed

If there is any deficiency, please let me know, thanks!

(Yinpeter) #6

Hi Matt,

I try to build ITK4.13.2/ITK5.0 and run HelloWorld carefully today, record the entire execution process of HelloWorld in detail.

Using ITK 4.13.2:

Using ITK 5.0:

  • Configure ITK in CMake with no issue.

  • Generate ITK Xcode project in CMake with no issue.

  • Build ITK library in Xcode with no issue, all targets/libraries have been built successfully.

  • Confiure HelloWorld in CMake with no issue.

  • Generate HelloWorld project in CMake with no issue.

  • Build HelloWorld project in Xcode with no issue and running result is normal.

in conclusion

  • Is it correct to use xcode to develop an ITK project on MacOS?
(Dženan Zukić) #7

The try-compile “issues” (ITK-4.13.2-Binary-Config-Issues-In-CMake.txt) are not important, they are checked so proper configuration (ITK-build\Modules\Core\Common\itkConfigure.h) can be made. Most people who develop on a Mac use XCode.

Which hello world example were you following, this or this? Can you supply CMakeLists.txt for your hello-world project? And your latest message is not quite clear to me: did everything work besides some warnings, or are you still failing to build your example?

(Yinpeter) #8

Hi Dzenanz,

Many thanks for your reply!

Today, I delete all the resources and re-downland everything from beginning.
Everything works fine under ITK5.0 as I mentioned, I will use it to continue study/plan my project, and give up to study ITK4.13.2

Attached is my HelloWorld’s CMakeLists.txt:
CMakeLists.txt (704 Bytes)

Thank you again!

Peter Yin