c++移植IOS问题

windows : vs2010

Android: ndk-build

在 Mac 可以使用Makefile生成.a静态库(不支持动态库)或Xcode建立.a静态库工程


问题1 .生成 .a调用时出现以下问题

Ld Build/Products/Debug-iphoneos/TestDemo.app/TestDemo normal arm64
    cd /Users/mac/Desktop/cpp/txprj/app/ios/TestDemo
    export IPHONEOS_DEPLOYMENT_TARGET=7.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/mac/Desktop/cpp/txprj/app/ios/TestDemo/Build/Products/Debug-iphoneos -L/Users/mac/Desktop/cpp/txprj/app/ios/TestDemo -L/Users/mac/Desktop/cpp/txprj/build/ios/walnut/Build/Products/Debug-iphonesimulator -L/Users/mac/Desktop/cpp/txprj/build/ios/walnut/Build/Products/Debug-iphoneos -F/Users/mac/Desktop/cpp/txprj/app/ios/TestDemo/Build/Products/Debug-iphoneos -filelist /Users/mac/Desktop/cpp/txprj/app/ios/TestDemo/Build/Intermediates/TestDemo.build/Debug-iphoneos/TestDemo.build/Objects-normal/arm64/TestDemo.LinkFileList -dead_strip -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.1 -framework CoreGraphics -framework CoreData -lwalnut -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/mac/Desktop/cpp/txprj/app/ios/TestDemo/Build/Intermediates/TestDemo.build/Debug-iphoneos/TestDemo.build/Objects-normal/arm64/TestDemo_dependency_info.dat -o /Users/mac/Desktop/cpp/txprj/app/ios/TestDemo/Build/Products/Debug-iphoneos/TestDemo.app/TestDemo

Undefined symbols for architecture arm64:
  "typeinfo for twl::SortedVectorImpl", referenced from:
      typeinfo for twl::SortedVector<twl::key_value_pair_t<twl::String, unsigned long> > in MainViewController.o
  "typeinfo for twl::VectorImpl", referenced from:
      typeinfo for twl::Vector<twl::key_value_pair_t<twl::String, twl::String> > in MainViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Apple LLVM - Language - C++    ->    Enable C++ Runtime Types -> Yes



问题2.编译指令集在模似器用i386

问题3.Xcode include 工程下的路径问题,设置Search Path -> User Header Serach Path 

问题4.Xcode混合编译设置 Language\Compiled Source As Objective-C++


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

白錵錵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值