xcode 配置:错误:C 编译器无法创建可执行文件 - React Native
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48928498/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
configure: error: C compiler cannot create executables- React Native
提问by Anju
I have been trying to build my react native project but getting error
我一直在尝试构建我的 React Native 项目,但出现错误
React native version : .48.4
反应本机版本:.48.4
Xcode : 9.1
代码:9.1
configure: WARNING: 'missing' script is too old or missing
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /opt/Xilinx/SDK/2017.1/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-gcc
checking whether the C compiler works... no
configure: error: in `/node_modules/react-native/third-party/glog-0.3.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
回答by Suyog K.C
This solved that issue for me
这为我解决了这个问题
rm -r ~/.rncache/
cd node_modules/react-native/third-party/glog-0.3.4/
./configure --host arm-apple-darwin
回答by Guy
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
Solved the problem
解决了问题
回答by Jared Forsyth
From this comment: configure: error: C compiler cannot create executables- React Native
来自此评论:配置:错误:C 编译器无法创建可执行文件-React Native
Changing the name of the app from ~/Downloads/Xcode 10.1.app
to ~/Downloads/Xcode.app
fixed this problem for me. I wonder if it has to do with the space in the app name?
从更改应用程序的名称~/Downloads/Xcode 10.1.app
,以~/Downloads/Xcode.app
固定的这个问题对我来说。我想知道它是否与应用程序名称中的空格有关?
回答by Nandam Mahesh
I had the same issue,
我遇到过同样的问题,
below steps worked for me,
以下步骤对我有用,
- Restart your system
- under repo: cd node_modules/react-native/third-party/glog-0.3.4
- ../../scripts/ios-configure-glog.sh
- 重启你的系统
- 在 repo 下:cd node_modules/react-native/third-party/glog-0.3.4
- ../../scripts/ios-configure-glog.sh
回答by immodi
I have also faced this issue. To resolve this, You have to follow the below steps:
我也遇到过这个问题。要解决此问题,您必须按照以下步骤操作:
- Check the Xcode application name. If it has space (i.e. Xcode 11.1) then remove it (Xcode11.1).
- Open Terminal and type below command:
sudo xcode-select -s /Applications/Xcode11.1.app/Contents/Developer/
- Then run
Pod install
- 检查 Xcode 应用程序名称。如果它有空间(即 Xcode 11.1),则将其删除(Xcode11.1)。
- 打开终端并输入以下命令:
sudo xcode-select -s /Applications/Xcode11.1.app/Contents/Developer/
- 然后运行
Pod install
I hope this resolves your issue.
我希望这能解决您的问题。