How to build DCMTK 3.6.1 libs for iOS?

488 views Asked by At

I followed Russes' instructions found at http://forum.dcmtk.org/viewtopic.php?f=3&t=3047&start=15

With a fresh copy of his "afab" git branch, I built Xcode project for x86 arch with the command line:

cmake -DIOS_PLATFORM=SIMULATOR64 -G Xcode ../dcmtk.public

or for arm arch with:

cmake -DIOS_PLATFORM=OS -G Xcode ../dcmtk.public

However, my Xcode project can't be successfully built because of, at least, the following errors: List of Xcode errors on ofchrenc.cc file (for eg. "No class named Implementation in OFCharacterEncoding")

The compilation with Unix makefiles gives the same errors in my case:

Scanning dependencies of target ofstd

0% Building CXX object ofstd/libsrc/CMakeFiles/ofstd.dir/ofchrenc.cc.o

dcmtk.public/ofstd/libsrc/ofchrenc.cc:518:28: error: no class named 'Implementation' in 'OFCharacterEncoding' class OFCharacterEncoding::Implementation {};

dcmtk.public/ofstd/libsrc/ofchrenc.cc:556:31: error: out-of-line definition of 'getLocaleEncoding' does not match any declaration in 'OFCharacterEncoding' OFString OFCharacterEncoding::getLocaleEncoding()

/usr/local/include/dcmtk/ofstd/ofchrenc.h:97:21: note: member declaration does not match because it is const qualified const OFString &getLocaleEncoding() const;

[...] dcmtk.public/ofstd/libsrc/ofchrenc.cc:644:34: error: out-of-line definition of 'setConversionFlags' does not match any declaration in 'OFCharacterEncoding' OFCondition OFCharacterEncoding::setConversionFlags(const unsigned flags)

19 errors generated.

make 2: ofstd/libsrc/CMakeFiles/ofstd.dir/ofchrenc.cc.o Error 1

make 1: ofstd/libsrc/CMakeFiles/ofstd.dir/all Error 2

make: [all] Error 2

I don't understand what is wrong in my configuration:

  • MacOs Sierra 10.12.2

  • Xcode 8.2

  • CMake 3.7.1 (I have the same issue previously with 3.5.2 version)

  • GNU Make 3.81 (for Unix makefiles compilation)

  • Apple LLVM version 8.0.0.8000042

  • Darwin version of host: 16.3.0

  • Building for minimum iOS version: 10.2 (SDK version: 10.2)

1

There are 1 answers

2
J. Riesmeier On BEST ANSWER

I'm not sure about the first error message but

/usr/local/include/dcmtk/ofstd/ofchrenc.h:97:21: note: member declaration does not match because it is const qualified const OFString &getLocaleEncoding() const;

seems to indicate that you are mixing an old version of "ofchrenc.h" (stored in "/usr/local/...") with a more recent version of "ofchrenc.cc" (stored in your working directory).