C compiler cannot create executables

Hi!

For the last few builds i have constant fails due to the following error:

[00:00:12]: ▸ checking whether the C compiler works... no
[00:00:12]: ▸ configure: error: in `/Users/vagrant/git/node_modules/react-native/third-party/glog-0.3.4':
[00:00:12]: ▸ configure: error: C compiler cannot create executables
[00:00:12]: ▸ See `config.log' for more details
[00:00:12]: ▸ Command /bin/sh failed with exit code 77

I’ve tried changing Xcode versions however - nothing happened.

What’s funny, i have no problems with building the same app with the same Fastlane build on my local machine and on any new machine (which wasn’t used to build the app before).

Example build id: 7a0748fc7d86f5c4 .

Thanks for any help!

1 Like

Hi @gaborx,

Checked the build’s log, but there’s not enough details in it due to you run fastlane from a script. So far it seems to be either a fastlane version or a dependency issue.

Can you please use our fastlane Step to run fastlane instead? It does the same, just runs fastlane ... but also collects those diagnostic logs mentioned in fastlane’s log, and if you have the Deploy to Bitrise.io step (based on your log you do have that in the workflow) that will attach those files to the build (Build’s page on bitrise.io, Apps & Artifacts section).

Once you have that and you still have the issue please specify the new build ID where you now use the fastlane step.

Hi!

I’ve changed my shell executed fastlane to your fastlane step.

Build id is 7212b952d9ef93da . It’s the same error.

From the debug fastlane log, attached to the build (gym_CommunityClient-CommunityClient.log):

curl: Saved to filename 'glog-0.3.4.tar.gz'
Unpacking /Users/vagrant/.rncache/glog-0.3.4.tar.gz...
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
/Users/vagrant/git/node_modules/react-native/third-party/glog-0.3.4/missing: Unknown `--is-lightweight' option
Try `/Users/vagrant/git/node_modules/react-native/third-party/glog-0.3.4/missing --help' for more information
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... /usr/local/bin/gmkdir -p
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... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/vagrant/git/node_modules/react-native/third-party/glog-0.3.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command /bin/sh failed with exit code 77

Searching for glog-0.3.4/missing: Unknown --is-lightweight' option : https://github.com/facebook/react-native/issues/14382 seems to be a RN version issue.

I’d say you most likely have an older / different version on your Mac

I’d also suggest you to follow this guide, to debug the issue locally on your Mac:

You’'re a legend, worked like a charm.

And thanks for the additional tip!

1 Like

Glad to hear it worked, Happy Building! :blush:

I also have the “checking whether the C compiler works… no” problem.
I tried to compile giflib for Leptonica, with instruction on: http://www.sk-spell.sk.cx/compiling-leptonica-and-tesseract-ocr-with-mingwmsys
it says…

tar xf giflib-4.1.6.tar.bz2
cd giflib-4.1.6
./autogen.sh
LDFLAGS="-no-undefined -Wl,–as-needed" ./configure
make -j 4 && make install

but gave error:
configure: loading site script /etc/config.site
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /usr/bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether make supports nested variables… (cached) yes
checking for style of include used by make… GNU
checking for gcc… gcc
checking whether the C compiler works… no
configure: error: in `/usr/src/giflib-5.1.4’:
configure: error: C compiler cannot create executables

See `config.log’ for more details

what confusing me is, if just typed (in place of LDFLAGS=…):
$ ./configure
it will continue processing without error

I did on Msys2 shell/terminal with path /usr/local/bin:/usr/bin:/bin:/mingw64/bin (the last is added manually) not from mingw64 shell which has opposite oder - the last will be the first
How to solve this… ? I really need the guiding help… thanks much

Hi @abdu,

Seems you try to run mingw toolkit which is for Windows (AFAIK). We don’t have Windows VMs, only Linux & MacOS ones. Not 100% sure that’s the issue but it worth to check.

In any case, if you’d need further assistance please create a separate #issues:build-issues report as yours doesn’t seem to be related to the original issue in this thread :slight_smile: