gpt4 book ai didi

c - libc.h : No such file or directory when compiling nanomsg pipeline sample

转载 作者:太空狗 更新时间:2023-10-29 17:20:36 25 4
gpt4 key购买 nike

尝试运行一个简单的 nanomsg 文件,从这里的第一个文件开始:https://github.com/dysinger/nanomsg-examples

将 nanomsg 安装到 /usr/local/lib/nanomsg-0.2-alpha。运行 sudo ./configuresudo make checksudo make installsudo ldconfig 作为 instructions said .所有测试都通过。

当我运行时,它说找不到 libc.h:

$ gcc pipeline.c /usr/local/lib/libnanomsg.a -o pipeline
pipeline.c:2:18: fatal error: libc.h: No such file or directory
compilation terminated.

什么是 libc.h?自大学以来我没有做过任何 C 编程。它是 nanomsg 的一部分还是 C 库?

$ which gcc
/usr/bin/gcc
Ubuntu 12.04.4 LTS

最佳答案

Libc.h 只包含一小部分包含。编译 nanomsg 示例足以 ( src ):

替换:

#include <libc.h> 

#include <unistd.h>
#include <string.h>
#include <pthread.h>

我使用这个命令进行静态编译:

gcc -pthread bus.c ../nanomsg/.libs/libnanomsg.a -o test -lanl

注意行尾的 -pthread 和 -lanl。

关于c - libc.h : No such file or directory when compiling nanomsg pipeline sample,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21768542/

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