作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
尝试运行一个简单的 nanomsg 文件,从这里的第一个文件开始:https://github.com/dysinger/nanomsg-examples
将 nanomsg 安装到 /usr/local/lib/nanomsg-0.2-alpha
。运行 sudo ./configure
、sudo make check
、sudo make install
和 sudo 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/
我是一名优秀的程序员,十分优秀!