问题描述
我正在尝试一段时间编译此代码.具体来说,我正在尝试使用给定的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.
collect2:错误:ld返回1个退出状态
collect2: error: ld returned 1 exit status
make:*** [test/test_kyber]错误1
make: *** [test/test_kyber] Error 1
gcc版本
(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语版本:
目标:x86_64-redhat-linux-gnu
Target: x86_64-redhat-linux-gnu
线程模型:posix
Thread model: posix
运行make命令的输出.
Output running the make command.
/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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!