链接器错误-使用Cardboard SDK的CreateMainApp __EXPECTED_EXACTLY_ONE_VR_MAIN_APP_STATEMENT__ [英] Linker error - CreateMainApp __EXPECTED_EXACTLY_ONE_VR_MAIN_APP_STATEMENT__ with Cardboard SDK

查看:93
本文介绍了链接器错误-使用Cardboard SDK的CreateMainApp __EXPECTED_EXACTLY_ONE_VR_MAIN_APP_STATEMENT__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Google Cardboard应用,并在iOS中运行良好.但是将Soomla添加到项目中会导致链接器错误:

I am developing a Google Cardboard app and build fine in iOS. But adding Soomla to the project causes linker error:

Ld /Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/RealiteerCore normal armv7
cd /Users/foundway/GitHub/RealiteerCore/Build/RealiteerCoreIOS
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:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -L/Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Products/Release-iphoneos -L/Users/foundway/GitHub/RealiteerCore/Build/RealiteerCoreIOS -L/Users/foundway/GitHub/RealiteerCore/Build/RealiteerCoreIOS/Libraries -L/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Trampoline/Libraries -L/Users/foundway/GitHub/RealiteerCore/Assets/Plugins/iOS -F/Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Products/Release-iphoneos -filelist /Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/RealiteerCore.LinkFileList -Xlinker -map -Xlinker /Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/RealiteerCore-LinkMap-normal-armv7.txt -dead_strip -lc++ -weak_framework CoreMotion -weak-lSystem -ObjC -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 -framework Security -framework CoreText -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -liPhone-lib-il2cpp -liontext -lVuforia -lcardboard -lionimagecompression -lionimage -lremote_assets -lport -levent_internal -lQuantumCore -lbase -lNimbusCore -lrecorder -liongfx -lprotos_lib -lsoftware -lionwebp -lcardboard_protos -lionportgfx -lionstblib -lGoogleKitHUD -lionmath -lionlodepnglib -liongfxutils -lsensors -ltype -lapi -lprotobuf -lionfreetype2 -lionremote -lNimbusAttributedLabel -llogging -lProtocolBuffers -lUnityiOSProfile -lplatform -lSoomlaIOSCore -lvr -lionport -lcomposite -ldatatypes -ldevice -lNimbusModels -levent -lionanalytics -lgflags -lQCARUnityPlayer -lionbase -lionjsoncpp -lionzlib -ldevice_internal -lionmongoose -lGoogleKitCore -lionopenctm -lvrunity -lSoomlaiOSProfile -lUnitySoomlaiOSCore -llogging_protos -lionprofile -lsqlite3.0 -Xlinker -dependency_info -Xlinker /Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/RealiteerCore_dependency_info.dat -o /Users/foundway/Library/Developer/Xcode/DerivedData/Unity-iPhone-grxtfxrygreysieuyeovxlhlmgxu/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/RealiteerCore

Undefined symbols for architecture armv7:
  "gvr::CreateMainApp__EXPECTED_EXACTLY_ONE_VR_MAIN_APP_STATEMENT__(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)", referenced from:
      l001 in libplatform.a(vr_ios.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我刚刚将Soomla添加到了Cardboard应用程序中,但看起来Soomla和Google Cardboard正在争夺主要应用程序(libplatform.a来自Google Cardboard).我认为Google Cardboard必须成为主要应用.

I just added Soomla to my Cardboard app but looks like Soomla and Google Cardboard are fighting for main app (libplatform.a is from Google Cardboard). I think Google Cardboard need to be the main app.

所以,我想知道是否有其他方法可以使其他插件不争夺主应用程序?

So, I wonder if there are ways that I can make other plugins don't fight for main app?

它也可能是其他东西...除了我的理论之外.

It can be something else too... Above just my theory.

推荐答案

之所以发生这种情况,是因为Xcode构建标志-ObjC更改了.a文件的链接方式. Cardboard .a文件中有一些Cardboard SDK本身(例如CreateMainApp)不需要(或不需要)的代码.

This is happening because of the Xcode build flag -ObjC, which changes how the .a files are linked. There's some code in the Cardboard .a files which is not needed (or wanted) by the Cardboard SDK itself (CreateMainApp, for example).

您可以通过从Xcode的链接标志中删除-ObjC标志来解决此问题.注意:这可能会导致Soomla无法链接,但希望他们只是以防万一".因此,请先尝试此操作,如果仍然失败,请在此处评论.

You can fix this by removing the -ObjC flag from the link flags in Xcode. Note: this may cause Soomla to not link, but hopefully they only included it "just in case". So try this first, and if it still fails, please comment here.

这篇关于链接器错误-使用Cardboard SDK的CreateMainApp __EXPECTED_EXACTLY_ONE_VR_MAIN_APP_STATEMENT__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆