JUCE和React Native - 链接器错误“ld:找不到-lReact的库” [英] JUCE and React Native - linker error "ld: library not found for -lReact"
问题描述
我使用带有React Native的CocoaPods收到此链接器错误:
ld:找不到-lReact的库
I'm getting this linker error using CocoaPods with React Native:
ld: library not found for -lReact
我已按照 https的指南进行操作://facebook.github.io/react-native/docs/embedded-app-ios.html#content
我正在尝试与现有的iOS项目,这是一个JUCE C ++项目。 JUCE生成Xcode项目文件,所以我相信我需要使用Cocoapods方法。
I am trying to integrate with an existing iOS project, which is a JUCE C++ project. JUCE generates the Xcode project file so I believe I need to use the Cocoapods method.
我正在做的步骤是:
- 创建或保存iOS版本来自 Introjucer 项目
- 运行
npm install react-native
来自项目的根目录(以及.jucer
文件) - 创建Podfile in按照指南
Builds / iOS
(但../../ node_modules
作为路径) - 运行
pod install
- 在Xcode中打开工作区
- 调整
GCC_PREPROCESSOR_DEFINITIONS
包括$(继承)
- build
- create or save iOS build from Introjucer project
- run
npm install react-native
from root of project (alongside the.jucer
file) - create Podfile in
Builds/iOS
as per the guide (but with../../node_modules
as the path) - run
pod install
- open workspace in Xcode
- adjust
GCC_PREPROCESSOR_DEFINITIONS
to include$(inherited)
- build
显示此问题的示例项目位于 https://github.com/adamski/juce-native-navigation/tree/react-native-cocoapods
An example project displaying this issue is at https://github.com/adamski/juce-native-navigation/tree/react-native-cocoapods
我认为Introjucer生成的项目正在发生,正如我所说的那样在一个全新的Xcode项目上完成整个过程并且构建良好。
I think there is something going on with the Introjucer generated project, as I tried the whole process on a fresh new Xcode project and it builds fine.
我还尝试将 libReact.a
添加到'Link Binary With Libraries'部分,但似乎没有帮助。
I have also tried adding libReact.a
to the 'Link Binary With Libraries' section but that does not seem to have helped.
推荐答案
我查找了Introjucer生成的项目与Xcode生成的项目之间的差异。
I looked for differences between the Introjucer generated project and the Xcode generated one.
一个显着的区别是 CONFIGURATION_BUILD_DIR
或按配置构建产品路径
One significant difference was the CONFIGURATION_BUILD_DIR
or "Per-configuration Build Products Path"
我从Xcode生成的项目复制了设置
$(BUILD_DIR)/ $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
I copied over the setting from the Xcode generated project
$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
这使链接完成并成功构建:)
This allowed the linking to complete and gave a successful build :)
这篇关于JUCE和React Native - 链接器错误“ld:找不到-lReact的库”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!