我正在尝试使用Qt Creator在C++中使用PCL库与libfreenect进行学习。
由于我对C++不熟悉,因此最终遇到了编译示例时的错误:
ld: warning: in /usr/local/lib/libfreenect.dylib, file was built for i386 which is not the architecture being linked (x86_64)
make: Leaving directory `/Users/george/Documents/Qt/OKPCL'
Undefined symbols:
"_freenect_init", referenced from:
Freenect::Freenect::Freenect()in OKPCL.o
"_freenect_select_subdevices", referenced from:
Freenect::Freenect::Freenect()in OKPCL.o
"_freenect_process_events", referenced from:
Freenect::Freenect::operator()()in OKPCL.o
"_freenect_shutdown", referenced from:
Freenect::Freenect::~Freenect()in OKPCL.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [OKPCL] Error 1
The process "/usr/bin/make" exited with code 2.
Error while building project OKPCL (target: Desktop)
When executing build step 'Make'
libfreenect是针对我的机器(运行osx 10.6.8)的i386架构构建的。 我注意到Qt Creator默认的Make会执行以下操作:
make: Entering directory `/Users/george/Documents/Qt/OKPCL'
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o OKPCL main.o OKPCL.o -F/Users/george/QtSDK/Desktop/Qt/474/gcc/lib -L/Users/george/QtSDK/Desktop/Qt/474/gcc/lib /usr/local/lib/libfreenect.dylib /usr/local/lib/libpcl_io.dylib /usr/local/lib/libpcl_common.dylib -framework QtCore
在 .pro 文件中,是否有一个可以设置 Qt 标志的选项,以便将架构设置为 i386 而不是 x86_64?