【问题标题】:ld: symbol(s) not found for architecture i386 IOS c++ld:未找到体系结构 i386 IOS c++ 的符号
【发布时间】:2015-03-11 13:24:54
【问题描述】:

当我尝试为 iphone Simulator 编译时出现以下错误。 我正在尝试使用没有提升的 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)

【问题讨论】:

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


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      我面临同样的问题,我认为这是因为该库不支持模拟器 SDK。它应该在设备上编译

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-06-17
        • 1970-01-01
        • 2012-07-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-02-15
        相关资源
        最近更新 更多