c++ - ld : symbol(s) not found for architecture i386 IOS c++

标签 c++ ios-simulator cocos2d-x poco-libraries i386

当我尝试为 iphone 模拟器编译时出现以下错误。 我正在尝试使用没有提升的 websockets 和 cocos2d-x 我添加了这个库 Poco websockets

Ld /Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Products/Debug-iphonesimulator/HelloCpp.app/HelloCpp normal i386
cd /Users/Goblintosh/Downloads/cocos2d-x-2.2.6/samples/Cpp/HelloCpp/proj.ios
export IPHONEOS_DEPLOYMENT_TARGET=5.1.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -L/Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Products/Debug-iphonesimulator -F/Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Products/Debug-iphonesimulator -filelist /Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Intermediates/HelloCpp.build/Debug-iphonesimulator/HelloCpp.build/Objects-normal/i386/HelloCpp.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1.1 /Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Products/Debug-iphonesimulator/libcocos2dx.a -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -lxml2 -lz -framework QuartzCore -Xlinker -dependency_info -Xlinker /Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Intermediates/HelloCpp.build/Debug-iphonesimulator/HelloCpp.build/Objects-normal/i386/HelloCpp_dependency_info.dat -o /Users/Goblintosh/Library/Developer/Xcode/DerivedData/HelloCpp-efjnfkcitxbilldlaldflpefelul/Build/Products/Debug-iphonesimulator/HelloCpp.app/HelloCpp

 Undefined symbols for architecture i386:

-

"Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()", referenced from:
    Poco::Net::Impl::IPv6SocketAddressImpl::~IPv6SocketAddressImpl() in HelloWorldScene.o
               Poco::Net::Impl::IPv4SocketAddressImpl::~IPv4SocketAddressImpl() in HelloWorldScene.o
  "Poco::Net::IPAddress::IPAddress(void const*, unsigned int)", referenced from:
                                  Poco::Net::Impl::IPv4SocketAddressImpl::host() const in HelloWorldScene.o
  "Poco::Net::IPAddress::IPAddress(void const*, unsigned int, unsigned int)", referenced from:
          Poco::Net::Impl::IPv6SocketAddressImpl::host() const in HelloWorldScene.o
  "typeinfo for Poco::Net::Impl::SocketAddressImpl", referenced from:
      typeinfo for Poco::Net::Impl::IPv4SocketAddressImpl in HelloWorldScene.o
      typeinfo for Poco::Net::Impl::IPv6SocketAddressImpl in HelloWorldScene.o

ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

我对 POCO 了解不多,但看看您对 clang++ 的调用,我可以肯定地说您没有将任何 POCO 库链接到您的应用程序。

请务必为“-L”和“-l”选项指定正确的值(XCode 中必须有一种方法可以做到这一点),一切都应该正常工作。

关于c++ - ld : symbol(s) not found for architecture i386 IOS c++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28987817/

相关文章:

c++ - 一个好的重新分区算法

ios - 视网膜模拟器显示非视网膜分辨率

ios - iPhone 模拟器 - 黑屏

android - 使用 Android 将示例项目导入 Eclipse Helios 失败

c++ - 使用 Cocos2d-x SEL_CallFunc

c++ - 删除 vector 中的指针时出错

c++ - Visual C++ 2012 中的正弦计算不一致?

c++ - 线程上下文的静态存储对象优化

ios - iOS模拟器仅显示屏幕的左下角

iphone - 如何在Cocos2d-x(C++ openGL)中制作可拉伸(stretch)图像