/usr/bin/ld: cannot find -lc while compiling with makefile

后端 未结 1 706
深忆病人
深忆病人 2020-12-03 00:51

Context first: I have a header (event.h), a program called event.c, and the main program main.c. This program will be compiled, generating first a object program (event.o),

相关标签:
1条回答
  • 2020-12-03 01:21

    The specific error is the following line:

    /usr/bin/ld: cannot find -lc
    

    The linker cannot find the C libraries required for statically linking your library. You can try and see if libc.a already exists on your system by calling locate libc.a. If this returns, add an appropriate library flag pointing to the directory that includes libc.a.

    If libc.a is not installed, you unfortunately need to install the library if you want to compile your library statically. Since you stated you are on CentOS, you should be able to accomplish this with yum install glibc-static.

    0 讨论(0)
提交回复
热议问题