Linker error: /usr/bin/ld: cannot find -lc

别来无恙 提交于 2020-01-03 02:25:08

问题


I am trying to compile this code for some time. Specifically, I am trying to compile the avx2 code using the given mac. However, I am always getting the following error. I have looked up a lot but unable to find a solution. I will be very glad if you help me to find a solution.

/usr/bin/ld: cannot find -lc

collect2: error: ld returned 1 exit status

make: *** [test/test_kyber] Error 1

gcc version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)

Copyright (C) 2015 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang version :

clang version 3.4.2 (tags/RELEASE_34/dot2-final)

Target: x86_64-redhat-linux-gnu

Thread model: posix

Output running the make command.

/usr/bin/gcc -Wall -Wextra -O3 -fomit-frame-pointer -msse2avx -mavx2 -march=native -static -o test/test_kyber kyber.c poly.c polyvec.c fips202.o fips202x4.c precomp.c ntt.c verify.c indcpa.c consts.c kex.c nttlevels0t4.s nttlevels5t7.s mul_coefficients.s polyvec_pointwise_acc.s poly_add.s poly_sub.s cbd.s poly_freeze.s crypto_stream_aes256ctr.c keccak4x/KeccakP-1600-times4-SIMD256.o randombytes.c test/test_kyber.c

/usr/bin/ld: cannot find -lc

collect2: error: ld returned 1 exit status

make: *** [test/test_kyber] Error 1


回答1:


thanks a lot for your help and time. I understood the problem. The makefile adds a -static flag, but on our office machines we don't have static libc.a. Hence, the error "cannot find -lc". I removed the static flag and it works fine for now. I think we don't need a static libc.a, but I will have to check more closely.



来源:https://stackoverflow.com/questions/45938875/linker-error-usr-bin-ld-cannot-find-lc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!