【发布时间】:2012-02-08 14:02:26
【问题描述】:
我正在 iPhone 上开发条形码阅读器应用程序。我正在使用网络上提供的 Zbar 条码阅读器应用程序。我已经尝试过示例代码,它工作正常。它正在扫描条形码。 现在我想获取代码并将其作为唯一 ID 传递到我的 SQLite 数据库中。 问题是当我尝试添加 SQLite 和条形码库时。它给了我这样的错误:
Undefined symbols for architecture i386:
"_objc_autoreleasePoolPush", referenced from:
_main in main.o
"_objc_msgSend", referenced from:
_main in main.o
-[AppDelegate dealloc] in AppDelegate.o
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
-[AppDelegate createEditableCopyOfDatabaseIfNeeded] in AppDelegate.o
-[AppDelegate applicationDocumentsDirectory] in AppDelegate.o
-[ViewController databaseOpen] in ViewController.o
-[ViewController SaveData:] in ViewController.o
...
"_NSStringFromClass", referenced from:
_main in main.o
"_objc_autoreleasePoolPop", referenced from:
_main in main.o
我收到 28 个相同类型的错误.. 我在网上搜索过。但是没有人在 SQLite 中使用过条形码。他们使用了其他数据库。我可以使用 SQLite 数据库来存储条码获取的数据吗?如何修复这些错误?
【问题讨论】:
-
确保将两个库都添加到项目的框架列表中。
-
您需要提供更详细的链接器错误,以便了解它在抱怨什么。
-
@Rayfleck - 请参阅我正在使用 libsqlite3.dylib 进行 SQLite 和条形码读取我正在使用 AVFoundation、QuartzCore、CoreMedia、CoreGraphics、libliconv.2.dylib ......所以有可能他们之间有冲突吗?
-
您需要将错误放在主要问题或 paste.org 或 gist.github.com 上。在 cmets 中不好。
-
哦,我会的。谢谢 smparkes
标签: iphone objective-c sqlite linker barcode