I'm trying to make a small change to our existing iPhone app that uses ZXing to scan barcodes, and I need some help. I've been searching SO all day to try to get this resolved, with no luck.
It's been many moons (well over a year) since we last updated this app. It's an older version that we need to keep going for one customer, although for other customers I've used Xamarin to create a cross-platform app that works with Android and iOS (and WP 8, although no one is using that one yet). So the single Mac we have that was used by a former employee to create the app and now we just use to compile our Xamarin version has been updated to use XCode 4.6.2.
When I made a change to the code and tried to rebuild, I got several errors which I fixed after finding help here on SO. Now I'm getting some errors that no answers on SO have been able to resolve.
Here are the errors I'm getting:
Undefined symbols for architecture armv7:
"zxing::common::StringUtils::SHIFT_JIS", referenced from:
zxing::qrcode::DecodedBitStreamParser::decodeKanjiSegment(zxing::Ref<zxing::BitSource>, std::string&, int) in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
"zxing::common::StringUtils::GB2312", referenced from:
zxing::qrcode::DecodedBitStreamParser::decodeHanziSegment(zxing::Ref<zxing::BitSource>, std::string&, int) in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
"zxing::common::StringUtils::ASCII", referenced from:
zxing::qrcode::DecodedBitStreamParser::decodeNumericSegment(zxing::Ref<zxing::BitSource>, std::string&, int) in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
zxing::qrcode::DecodedBitStreamParser::decodeAlphanumericSegment(zxing::Ref<zxing::BitSource>, std::string&, int, bool) in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
"zxing::WhiteRectangleDetector::detect()", referenced from:
zxing::datamatrix::Detector::detect() in libZXingWidget.a(Detector-9FC86B67C0CBCF52.o)
"zxing::common::StringUtils::UTF8", referenced from:
zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned long, char const*) in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
"zxing::common::StringUtils::guessEncoding(unsigned char*, int, std::map<unsigned int, std::string, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::string> > > const&)", referenced from:
zxing::qrcode::DecodedBitStreamParser::decodeByteSegment(zxing::Ref<zxing::BitSource>, std::string&, int, zxing::common::CharacterSetECI*, zxing::ArrayRef<zxing::ArrayRef<unsigned char> >&, std::map<unsigned int, std::string, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::string> > > const&) in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
As you can see, the errors are all in the zxing namespace. I can load the ZXingWidget project and build it with no errors, but my project which includes it won't link to the zxing core stuff. I've tried switching the C++ compiler, standard library, language dialect, etc.
At this point I'll take either of two solutions:
- Fix my project so it builds
- Remove the ZXingWidget project from my project and somehow just pull in the binary as a dependency. I'm not an Objective-C or XCode developer, so I don't know how to do that. In the Visual Studio world instead of having the ZXingWidget project in my solution and including a project reference I'd just put the DLL in a folder in my solution and include it as a regular DLL reference.