链接器错误:/usr/bin/ld:找不到-lc [英] Linker error: /usr/bin/ld: cannot find -lc

查看:268
本文介绍了链接器错误:/usr/bin/ld:找不到-lc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试一段时间编译此代码.具体来说,我正在尝试使用给定的mac编译avx2代码.但是,我总是遇到以下错误. 我已经查询了很多,但是找不到解决方案.如果您能帮助我找到解决方案,我将非常高兴.

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:找不到-lc

/usr/bin/ld: cannot find -lc

collect2:错误:ld返回1个退出状态

collect2: error: ld returned 1 exit status

make:*** [test/test_kyber]错误1

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

gcc版本

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

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

(C)2015自由软件基金会版权所有.

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.

C语版本:

clang版本3.4.2(标签/RELEASE_34/dot2-final)

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

目标:x86_64-redhat-linux-gnu

Target: x86_64-redhat-linux-gnu

线程模型:posix

Thread model: posix

运行make命令的输出.

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 ke 1600次4-SIMD256.o randombytes.c test/test_kyber.c

/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:找不到-lc

/usr/bin/ld: cannot find -lc

collect2:错误:ld返回1个退出状态

collect2: error: ld returned 1 exit status

make:*** [test/test_kyber]错误1

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

推荐答案

非常感谢您的帮助和时间.我了解这个问题.生成文件添加了-static标志,但是在我们的办公计算机上,我们没有静态libc.a.因此,错误无法找到-lc".我删除了静态标志,它现在可以正常工作. 我认为我们不需要静态的libc.a,但是我将不得不仔细检查.

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.

这篇关于链接器错误:/usr/bin/ld:找不到-lc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆