我有一个程序。是人家给的。xcode写的库,xcode的示例。运行正常。我自己有个程序用qt写的,写了很久了。现在想把这部分程序加到我的程序里。我用qt调用库出现这样的总是:
:-1: error: symbol(s) not found for architecture armv7
:-1: error: linker command failed with exit code 1 (use -v to see invocation)
Ld untitled.build/Release-iphoneos/untitled.build/Objects-normal/arm64/untitled normal arm64
cd /Users/xujianxiang/build-untitled-iphoneos_clang_Qt_5_4_0_for_iOS-Release
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/xujianxiang/build-untitled-iphoneos_clang_Qt_5_4_0_for_iOS-Release/Release-iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks -L/Users/xujianxiang/untitled -L/Users/xujianxiang/Qt5.4.0/5.4/ios/plugins/platforms -L/Users/xujianxiang/Qt5.4.0/5.4/ios/lib -L/Users/xujianxiang/Qt5.4.0/5.4/ios/plugins/imageformats -F/Users/xujianxiang/build-untitled-iphoneos_clang_Qt_5_4_0_for_iOS-Release/Release-iphoneos -filelist /Users/xujianxiang/build-untitled-iphoneos_clang_Qt_5_4_0_for_iOS-Release/untitled.build/Release-iphoneos/untitled.build/Objects-normal/arm64/untitled.LinkFileList -dead_strip -headerpad_max_install_names -framework OpenGLES -framework UIKit -stdlib=libc++ -u _qt_registerPlatformPlugin -L/Users/xujianxiang/untitled/ -L/Users/xujianxiang/Qt5.4.0/5.4/ios/plugins/platforms -framework UIKit -L/Users/xujianxiang/Qt5.4.0/5.4/ios/lib -framework OpenGLES -L/Users/xujianxiang/Qt5.4.0/5.4/ios/plugins/imageformats -lz -lm -miphoneos-version-min=6.0 -framework OpenAL -framework AudioToolbox -framework QuartzCore -lHCNetSDK_dev_20141219 -lplayctrl -lSystemTransform -lqios -framework Foundation -framework CoreFoundation -framework CoreText -framework CoreGraphics -lQt5PlatformSupport -lQt5Widgets -lqdds -lqicns -lqico -lqjp2 -lqmng -lqtga -lqtiff -lqwbmp -lQt5Gui -lqtharfbuzzng -lQt5Core -Xlinker -dependency_info -Xlinker /Users/xujianxiang/build-untitled-iphoneos_clang_Qt_5_4_0_for_iOS-Release/untitled.build/Release-iphoneos/untitled.build/Objects-normal/arm64/untitled_dependency_info.dat -o /Users/xujianxiang/build-untitled-iphoneos_clang_Qt_5_4_0_for_iOS-Release/untitled.build/Release-iphoneos/untitled.build/Objects-normal/arm64/untitled
Undefined symbols for architecture arm64:
"std::string::at(unsigned long)", referenced from:
TiXmlElement::StreamIn(std::istream*, std::string*) in libHCNetSDK_dev_20141219.a(tinyxmlparser.o)
TiXmlComment::StreamIn(std::istream*, std::string*) in libHCNetSDK_dev_20141219.a(tinyxmlparser.o)
"std::string::compare(char const*) const", referenced from:
CXmlBase::FindElem(char const*) in libHCNetSDK_dev_20141219.a(XmlBase.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
ld: symbol(s) not found for architecture arm64
请问怎么解决这个问题
------解决思路----------------------
用tinyxml,tinyxml是个开源的库,这个库用到了stl的东西,引用的stl库和你的目标架构(arm64)不匹配。猜测可能你的库是用32位的toolchain编译的?或者有其他不兼容你现在toolchain中stl库的东西,要问问提供你库的人了。