gpt4 book ai didi

c - ld : Can't find library for -lc

转载 作者:太空宇宙 更新时间:2023-11-04 03:33:41 25 4
gpt4 key购买 nike

我正在尝试使用静态标志(静态链接)构建一个 C 程序。当我尝试这样做时,链接器抛出错误“找不到 -lc 的库”。我使用的机器是 HP-UX。我不知道它需要哪个库以及在哪里可以找到它,以便在使用 -L 选项构建程序时可以包含默认搜索位置。

avotclbh:/home/akhils/test_prog#
avotclbh:/home/akhils/test_prog#gcc -v
Using built-in specs.
Target: ia64-hp-hpux11.31
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3
You have mail in /var/mail/root
avotclbh:/home/akhils/test_prog#


avotclbh:/home/akhils/test_prog#gcc -v -static test_debugging.c -o test_debugging.out -L/usr/lib/hpux64
Using built-in specs.
Target: ia64-hp-hpux11.31
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3
/usr/local/libexec/gcc/ia64-hp-hpux11.31/4.2.3/cc1 -quiet -v test_debugging.c -quiet -dumpbase test_debugging.c -auxbase test_debugging -version -o /var/tmp//ccjCisnQ.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/../../../../ia64-hp-hpux11.31/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/include
/usr/include
End of search list.
GNU C version 4.2.3 (ia64-hp-hpux11.31)
compiled by GNU C version 4.2.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 207e4f838aed34ece15d2a59ed6e0ca7
/usr/local/bin/as -x -o /var/tmp//cceZpXhF.o /var/tmp//ccjCisnQ.s
/usr/local/libexec/gcc/ia64-hp-hpux11.31/4.2.3/collect2 -z +Accept TypeMismatch -u main -noshared -o test_debugging.out crt0.o /usr/lib/hpux32/unix98.o -L/usr/lib/hpux64 -L/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3 -L/usr/ccs/lib -L/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/../../.. /var/tmp//cceZpXhF.o -lgcc -lc -lgcc
**ld: Can't find library for -lc
Fatal error.
collect2: ld returned 1 exit status**
avotclbh:/home/akhils/test_prog#

此外,我的机器上已经安装了以下依赖项

avotclbh:/home/akhils/test_prog#swlist -l product |grep -iE "gcc|zlib|libiconv|gettext"
gcc 4.2.3 gcc
gettext 0.19.5.1 gettext
libiconv 1.14 libiconv
zlib 1.2.8 zlib
avotclbh:/home/akhils/test_prog#

最佳答案

安装glibc库包。

关于c - ld : Can't find library for -lc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34178941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com