在将 ZXingWidget 包含到我之前的 iOS 项目中时,我遇到了一些问题。
这是我之前使用 XCode4.3+ARC for iOS 开始的一个项目。对于这个项目,我需要包括 ZXing 来扫描。
我已按照提供的自述文件进行操作。
注意事项:
但我无法直接从我的代码中导入任何文件 (#import 不起作用)。
我也试过这个solution没有运气。
我还缺少任何其他可能性吗?
感谢任何帮助!
我现在得到一些错误输出。
Undefined symbols for architecture i386:
"std::ios_base::Init::Init()", referenced from:
___cxx_global_var_init in libZXingWidget.a(Binarizer.o)
___cxx_global_var_init in libZXingWidget.a(BinaryBitmap.o)
___cxx_global_var_init in libZXingWidget.a(Array.o)
___cxx_global_var_init in libZXingWidget.a(BitArray.o)
___cxx_global_var_init in libZXingWidget.a(BitMatrix.o)
___cxx_global_var_init in libZXingWidget.a(BitSource.o)
___cxx_global_var_init in libZXingWidget.a(Counted.o)
...
"std::terminate()", referenced from:
zxing::Binarizer::Binarizer(zxing::Ref<zxing:uminanceSource>) in libZXingWidget.a(Binarizer.o)
zxing::Binarizer::~Binarizer() in libZXingWidget.a(Binarizer.o)
zxing::BinaryBitmap::BinaryBitmap(zxing::Ref<zxing::Binarizer>) in libZXingWidget.a(BinaryBitmap.o)
zxing::BinaryBitmap::~BinaryBitmap() in libZXingWidget.a(BinaryBitmap.o)
zxing::BinaryBitmap::getBlackRow(int, zxing::Ref<zxing::BitArray>) in libZXingWidget.a(BinaryBitmap.o)
zxing::BinaryBitmap::getWidth() const in libZXingWidget.a(BinaryBitmap.o)
zxing::BinaryBitmap::getHeight() const in libZXingWidget.a(BinaryBitmap.o)
...
"operator delete(void*)", referenced from:
zxing::Binarizer::~Binarizer() in libZXingWidget.a(Binarizer.o)
zxing::Counted::~Counted() in libZXingWidget.a(Binarizer.o)
zxing::BinaryBitmap::~BinaryBitmap() in libZXingWidget.a(BinaryBitmap.o)
zxing::BinaryBitmap::crop(int, int, int, int) in libZXingWidget.a(BinaryBitmap.o)
zxing::BinaryBitmap::rotateCounterClockwise() in libZXingWidget.a(BinaryBitmap.o)
zxing::Counted::~Counted() in libZXingWidget.a(BinaryBitmap.o)
zxing::BitArray::~BitArray() in libZXingWidget.a(BitArray.o)
...
"___cxa_allocate_exception", referenced from:
zxing::Counted::release() in libZXingWidget.a(Binarizer.o)
zxing::Counted::release() in libZXingWidget.a(BinaryBitmap.o)
zxing::BitArray::setRange(int, int) in libZXingWidget.a(BitArray.o)
zxing::BitArray::isRange(unsigned long, unsigned long, bool) in libZXingWidget.a(BitArray.o)
zxing::BitMatrix::setRegion(unsigned long, unsigned long, unsigned long, unsigned long) in libZXingWidget.a(BitMatrix.o)
zxing::Counted::release() in libZXingWidget.a(BitMatrix.o)
zxing::BitSource::readBits(int) in libZXingWidget.a(BitSource.o)
...
您需要将 main.m
重命名为 main.mm
。这将告诉 Xcode 链接必要的 C++ 库,而这是缺少的。
关于objective-c - 包含 Zxing 到 Xcode 4.3 + Obj-C 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11545341/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |