问题描述:今天研究QCAR的iPhone版本,下载Demo后编译报错,如下:
ld: warning: ignoring file ../../build/lib/arm/libQCAR.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"QCAR::deinit()", referenced from:
-[EAGLView onDestroy] in EAGLView.o
"QCAR::onResume()", referenced from:
-[EAGLView onResume] in EAGLView.o
-[EAGLView updateApplicationStatus:] in EAGLView.o
"QCAR::onPause()", referenced from:
-[EAGLView onPause] in EAGLView.o
"QCAR::setHint(unsigned int, int)", referenced from:
-[EAGLView updateApplicationStatus:] in EAGLView.o
"QCAR::onSurfaceCreated()", referenced from:
-[EAGLView initApplication] in EAGLView.o
"QCAR::onSurfaceChanged(int, int)", referenced from:
-[EAGLView initApplication] in EAGLView.o
"QCAR::setInitParameters(int)", referenced from:
-[EAGLView initQCAR] in EAGLView.o
"QCAR::init()", referenced from:
-[EAGLView initQCAR] in EAGLView.o
"QCAR::Tracker::getInstance()", referenced from:
-[EAGLView loadTracker] in EAGLView.o
-[EAGLView startCamera] in EAGLView.o
-[EAGLView stopCamera] in EAGLView.o
"QCAR::CameraDevice::getInstance()", referenced from:
-[EAGLView startCamera] in EAGLView.o
-[EAGLView stopCamera] in EAGLView.o
-[EAGLView configureVideoBackground] in EAGLView.o
-[OverlayView actionSheet:clickedButtonAtIndex:] in OverlayView.o
"QCAR::Tool::getProjectionGL(QCAR::CameraCalibration const&, float, float)", referenced from:
-[EAGLView startCamera] in EAGLView.o
"QCAR::Renderer::getInstance()", referenced from:
-[EAGLView configureVideoBackground] in EAGLView.o
-[EAGLView renderFrameQCAR] in EAGLView.o
"QCAR::requiresAlpha()", referenced from:
-[EAGLView initRendering] in EAGLView.o
"QCAR::State::~State()", referenced from:
-[EAGLView renderFrameQCAR] in EAGLView.o
"QCAR::State::getNumActiveTrackables() const", referenced from:
-[EAGLView renderFrameQCAR] in EAGLView.o
"QCAR::State::getActiveTrackable(int) const", referenced from:
-[EAGLView renderFrameQCAR] in EAGLView.o
"QCAR::Tool::convertPose2GLMatrix(QCAR::Matrix34F const&)", referenced from:
-[EAGLView renderFrameQCAR] in EAGLView.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
问题分析:开始以为是没有找到库,重新引用库,无效。后查Google,要删除掉Targets-Build Settings-Library Search Paths,照做,无效。最后找到以下这段:
It seems the library is built for phone deployment (ARM) but you are trying to link it to a simulator executable (x86). This won't work. Rebuild the library for the simulator.
|
问题解决:切换成Device编译,搞定。
您好
我也遇到同樣的問題,但我對Xcode還不熟,不知道您所說的”切換成Device編譯”要在哪裡切換?謝謝
Vince
就在Xcode最上面那个bar的最左边,选模拟器或是真机,选择真机即可。
朋友,我有库作为一个可执行文件(libQcar.a),如何重建它
很抱歉,我可怜的中国翻译。
如何重建?