- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
整合Zxing ,二维码阅读器框架,在我的 iPhone 项目中。我从 here 查看了 ZXing sdk。 .我运行了 ZXing 附带的名为 ScanTest 的示例项目,没有任何问题。但是,当我尝试将该库与我的项目集成时,出现了上述错误。
当我构建时,在 ZXing readme file 中完成每个集成步骤之后,我收到类似
的构建错误Undefined symbols for architecture armv7:
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
zxing::qrcode::Detector::computeDimension(zxing::Ref<zxing::ResultPoint>, zxing::Ref<zxing::ResultPoint>, zxing::Ref<zxing::ResultPoint>, float) in libZXingWidget.a(Detector-B8B28E953F840D47.o)
Undefined symbols for architecture armv7:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
zxing::Exception::Exception(char const*) in libZXingWidget.a(Exception.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> > >
这样的错误有 27 个。我只复制了前两个。
好吧,我经历了this , this , this , this , this , this , this stackoverflow 中的线程,都具有相同的错误消息。没有一种解决方案对我有用。
然后我找到this closed thread在 ZXing 论坛讨论同样的问题。从那次讨论中,一些可能的解决方案是(对某些人有效)
The first error is (probably) because you haven't renamed main.m to main.mm. The second error is (probably) because you're not linking against the widget library
我还重命名了我的 main.m,交叉检查我是否添加了库才发现我肯定有。所以事实并非如此。
After I changed the Architectures of the library to "Standard (armv7, armv7s)" to match my main project I was able to successfully compile the app.
我的项目、目标、库项目(用于调试、分发、发布)架构为标准(armv7、armv7s)
。所以那里也没有运气。
然后他们关闭了这个问题,
The zxing projects have been updated to add the armv7s arch and remove the armv6 arch. These changes are required (1) to build for the iPhone 5 which is armv7s and (2) to build at all since Xcode 4.5 does not include support for armv6. If you have your own project files, you'll need to make these changes yourself. These are general changes not specific to zxing so if you have trouble, you make get more/quicker help in a general forum like StackOverflow.
所以我在 StackOverflow 中。
在ZXing集成中README file ,整合的第一步是,
1) Locate the "ZXingWidget.xcodeproj" file under "
zxing/iphone/ZXingWidget/
". Drag ZXingWidget.xcodeproj and drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add". Alternatively you can right-click on you project navigator and select 'Add files to "MyProject"'.
当我将 ZXingWidget.xcodeproj 文件拖到我的项目中时,没有对话框。该项目直接添加到项目中,我无法设置“复制项目”和“引用类型”属性。不知道是Xcode 4.5的新特性还是bug。根据 README 文件,这是我无法正确遵循的唯一步骤。
嗯,你有我所有的信息。我一直在尝试修复此问题 6 个小时。有什么想法吗?
最佳答案
好吧,最后我让它工作了..对于将来遇到这种情况的任何人..
将 main.m 文件重命名为 main.mm。
ZXing 的 README 说明了我们为什么需要这个
It can happen that when trying to build your own project with ZXingWidgetController you get linker errors like "undefined reference to". If this error looks like a c++ undefined reference, then renaming main.m into main.mm (Objective-C++ source suffix) may fix the problem
重命名使用 ZXing 库的文件 (ViewController/View)功能,使其也具有 .mm 扩展名。
检查整个项目的架构设置。给architecture 和 valid architecture 作为 armv7 armv7s 在你的项目设置、目标设置和 ZXing 项目(你添加到您的主项目)和目标设置。
在主 project -> Build Settings 滚动并找出选项、C++ 语言方言 和C++ 标准库。为它们选择选项 “Compiler Default”。 (这是我错过的步骤,这是必需的,因为最新的 XCode 模板有编译器默认设置与旧版本不同版本)。
您可能还必须设置 ZXingWidget 的“Build Valid ArchitectureOnly”标志设置为NO
。在我的例子中,这个字段已经是NO
这些解决了我的问题..
因此鼓励开发人员转移到 native Apple framework to read barcode从 iOS7 开始可用。参见 this获取分步教程。
关于ios - 在 Xcode 4.5 中使用 ZXing 库时架构 armv7 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12968369/
我正在为我的移动应用程序项目使用 worklight。我的问题是,我不知道在哪里可以找到这些文件(zxing-all-in-one.cpp 和 zxing-all-in-one.h),用于在 Xcod
我在 .NET 上使用 zxing 取得了巨大成功,并试图获得解码 QR 条码的最佳速度(我有很多事情要做——1.8M)。我正在使用的代码(它的一部分): // Create Barcode deco
我使用 com.google.zxing.qrcode.QRCodeWriter 对数据进行编码,并使用 com.google.zxing.client.j2se.MatrixToImageWrite
我项目的包名是 com.mohit.verma 我不想在外部安装 zxing 条码扫描仪应用程序。 我只想使用库文件。 那么我应该在哪里更改包名称? 任何帮助,将不胜感激... 我的代码如下: ba
我正在尝试使用说明 here 构建 Zxing android 应用程序(不是库) .我能够构建 jar 但无法构建应用程序本身。当我运行 mvn package android:apk 时,出现以下
本文整理了Java中jsc.kit.zxing.zxing.ui.ZXingFragment类的一些代码示例,展示了ZXingFragment类的具体用法。这些代码示例主要来源于Github/Stac
我正在开发一个通过 ZXing 在 Android 上扫描条形码的应用程序。我关注这个tutorial . 但是当我运行我的应用程序时,出现 NoClassDefFoundError 并且应用程序已完
我已经下载了适用于 Android 的 Zxing Barcode Scanner 代码,但我在源代码中找不到软件包 com.google.zxing。我认为该项目缺少库或 JAR 文件。谁能帮我找到
我正在尝试做一个应用程序来为多个条形码的信息创建一个最终的二维码我扫描过的。我想知道您如何将 ZXing 库导入您的代码?假设用户已经在他们的手机中安装了 ZXing 扫描仪,我是否可以只连接应用程序
我正在尝试使用 ZXing 2.1 库获得成功的结果。我在 Mac OS X 10.7.5 上使用 Java 1.6。我能够编码文本但不能解码任何图像。相反,我得到的只是 com.google.zxi
我正在使用 ZXing.Net 0.16.4.0 解码保存在 中的二维码文件'wwwroot/qrr' 文件夹,但我收到编译时错误: Cannot convert from 'System.Drawi
我已经将 Zxing 作为库集成并在我的应用程序中使用。我调用 Intent intent = new Intent("com.google.zxing.client.android.SCAN");
我正在尝试将 zxing 扫描仪合并到我的 Angular 应用程序中,在按照在线指南进行操作后,它出现了以下我似乎无法解决的错误, 'zxing-scanner' 不是已知元素: 如果“zxing-
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
我想实现来自 https://github.com/dm77/barcodescanner 的条码扫描器库.像这样运行项目后出现错误 java.lang.NoSuchFieldError: No st
我使用此代码生成我的二维码 ZXing.Net ( http://zxingnet.codeplex.com/ ) IBarcodeWriter writer = new BarcodeWriter
我想使用 ZXing 库制作一个二维码扫描器。在我的 build.gradle 中,我添加了以下代码: repositories { mavenCentral() maven {
我正在试验 ResultPoints,它返回与图像中条形码相关的点。 对于二维码,ResultPoints 返回一组 4 个点,它们是二维码每个角的四个框的坐标。 当我对条码进行同样的实验时,它返回两
我正在开发一个 android 应用程序,在其中我生成数据矩阵并允许用户使用 zxing 输入它们来扫描它们。 但是,出现了一个许可证问题,询问 zxing 扫描的所有格式是否都可用开源。 这与应用程
我将 ZXing.Net.Mobile 用于这样的表单 var scanPage = new ZXingScannerPage();
我是一名优秀的程序员,十分优秀!