Writing, because all the solutions I tried didn't work.
Error:
⚠️ Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: /bin/bash -c
set -e
cd sqlite-src-3450300
./configure
make sqlite3.c sqlite3.h sqlite3ext.h
checking build system type... arm-apple-darwin23.5.0
checking host system type... arm-apple-darwin23.5.0
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling...
configure: error: in `/Users/datachanturia/Library/Caches/CocoaPods/Pods/Release/sqlite3/3.45.3+1-02d1f/sqlite-src-3450300':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
pod install --repo-update --ansi exited with non-zero code: 1
Solution:
nano ~/.zshrc
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
source ~/.zshrc
TL;DR
It may be very tricky, it can not run, because in my case was compiling incorrectly.
I created C
"Hello World" program with zsh
terminal and tried compiling it with clang
. Every time I tried to run, system was killing it.
To find the issue, I created C
program in XCode, and ran it. It ran without issues, then found compiled file by XCode moved to exact same directory as "Hello World" program before (with cp
command): it ran without issues.
Here I understood problem wasn't how or from where compiled files run, but how they were compiled.
I logged XCode build & terminal build and found that, SDKROOT
difference was the cause: I had some other path, when XCode was using /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
.
So adding this path to SDKROOT
solved the issue.
P.S. 2 Days wasted on this