ld: library not found for -lgcc_s.10.5错误的解决

本文解决了一名开发者在升级Xcode到3.2.6后,遇到在真实设备上可以编译运行,但在模拟器上无法编译的困扰。通过修改`MACOSX_DEPLOYMENT_TARGET`的Build设置,将Compilerdefault改为10.6,最终成功解决了问题。

升级至Xcode 3.2.6,编译时出现“ld: library not found for -lgcc_s.10.5”错误,将Edit Project Settings中的Project Format修改为Xcode3.1-compatible。

这样可以在上真机编译和运行,但无法在模拟器上编译,修改n多build设置,错误依旧。

Googling,有人说是没有安装Unix开发包,但我明明装了的。不管,重新安装Xcode,把所有选项包勾上。无解。

正解在这里:http://stackoverflow.com/questions/1365211/error-in-xcode-project-ld-library-not-found-for-lcrt1-10-6-o

照做,Edit Project Settings->Build,将MACOSX_DEPLOYMENT_TARGET 由Compiler default修改为10.6。OK。







[root@localhost build]# echo $LD_LIBRARY_PATH /usr/local/smartchip/lib:/usr/local/openmpi/lib:/usr/local/openmpi/lib: [root@localhost build]# export LD_LIBRARY_PATH=/path/to/library:$LD_LIBRARY_PATH [root@localhost build]# find / -name "crt1.o" 2>/dev/null /usr/lib64/crt1.o [root@localhost build]# ln -s /usr/lib64/crt1.o /usr/lib/crt1.o [root@localhost build]# yum install -y gcc Last metadata expiration check: 1:58:52 ago on Wed 19 Nov 2025 02:35:42 PM CST. Package gcc-7.3.0-2020033101.58.p01.ky10.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete! [root@localhost build]# ../configure --prefix=/usr/local/gcc-10.2.0 checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /usr/bin/sed checking for gawk... gawk checking for libatomic support... yes checking for libitm support... yes checking for libsanitizer support... yes checking for libvtv support... yes checking for libhsail-rt support... yes checking for libphobos support... yes checking for gcc... gcc 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... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... no checking for gnatbind... no checking for gnatmake... no checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs configure: WARNING: using in-tree isl, disabling version check The following languages will be built: c,c++,fortran,lto,objc *** This configuration is not supported in the following subdirectories: gnattools gotools target-libada target-libhsail-rt target-libphobos target-zlib target-libgo target-libffi target-liboffloadmic (Any other directories should still work fine.) checking for default BUILD_CONFIG... bootstrap-debug checking for --enable-vtable-verify... no /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7.3.0/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7.3.0/libgcc_s.so when searching for -lgcc_s /usr/bin/ld: cannot find -lgcc_s /usr/bin/ld: cannot find -lc /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7.3.0/libgcc.a when searching for -lgcc /usr/bin/ld: cannot find -lgcc /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/7.3.0/libgcc_s.so when searching for -lgcc_s /usr/bin/ld: cannot find -lgcc_s /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status configure: error: I suspect your system does not have 32-bit development libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.
最新发布
11-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值