如何为 iOS 构建 DCMTK 3.6.1 库?

How to build DCMTK 3.6.1 libs for iOS?

我遵循了 Russes 在 http://forum.dcmtk.org/viewtopic.php?f=3&t=3047&start=15

中的说明

使用他的 "afab" git 分支的全新副本,我使用命令行为 x86 arch 构建了 Xcode 项目:

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

或用于手臂拱形:

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

但是,我的Xcode项目无法成功构建,至少有以下错误: List of Xcode errors on ofchrenc.cc file (for eg. "No class named Implementation in OFCharacterEncoding")

使用 Unix makefile 的编译在我的案例中给出了相同的错误:

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

我不明白我的配置有什么问题:

我不确定第一条错误消息,但是

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

似乎表明您正在将旧版本的 "ofchrenc.h"(存储在“/usr/local/...”)与较新版本的 "ofchrenc.cc"(存储在你的工作目录)。