dcmqi: Build fails on mac due to iconv undefined symbols

While testing https://github.com/QIICR/dcmqi/issues/394, I also found that the current master isn’t building on mac (10.14.6 mojave). Same machine builds Slicer fine, so there’s something off in the dcmqi superbuild configuration.

[  2%] Linking CXX executable ../../bin/ofstd_tests
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      OFCharacterEncoding::Implementation::convert(OFString&, char const*, unsigned long) in libofstd.a(ofchrenc.cc.o)
  "_iconv_close", referenced from:
      OFCharacterEncoding::Implementation::~Implementation() in libofstd.a(ofchrenc.cc.o)
  "_iconv_open", referenced from:
      OFCharacterEncoding::Implementation::create(OFString const&, OFString const&, OFCondition&) in libofstd.a(ofchrenc.cc.o)
  "_iconvctl", referenced from:
      OFCharacterEncoding::Implementation::getConversionFlags() const in libofstd.a(ofchrenc.cc.o)
      OFCharacterEncoding::Implementation::setConversionFlags(unsigned int) in libofstd.a(ofchrenc.cc.o)
  "_locale_charset", referenced from:
      OFCharacterEncoding::Implementation::getLocaleEncoding() in libofstd.a(ofchrenc.cc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [bin/ofstd_tests] Error 1
make[4]: *** [ofstd/tests/CMakeFiles/ofstd_tests.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [DCMTK-prefix/src/DCMTK-stamp/DCMTK-build] Error 2
make[1]: *** [CMakeFiles/DCMTK.dir/all] Error 2
make: *** [all] Error 2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 43 (42 by maintainers)

Commits related to this issue

Most upvoted comments

@pieper Thank you for the feedback. I will make sure that this patch (or something similar) will be committed to DCMTK’s git repository.

Several other brew tools depend on icu4c (e.g. ffmpeg) but as an experiment I was able to force remove it and then dcmtk and dcmqi build as expected (with tons of warnings).

After that, reinstalling dcmtk works, so this approach is a workaround if anyone needs it. But of course fixing the build system would be better.