尝试运行一个简单的nanomsg文件,从这里的第一个文件开始:https://github.com/dysinger/nanomsg-examples
将nanomsg安装到/usr/local/lib/nanomsg-0.2-alpha。Ran 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发布于 2014-12-05 18:53:37
H只包含包含的小列表。要编译nanomsg示例,它足以(src):
取代:
#include <libc.h> 使用
#include <unistd.h>
#include <string.h>
#include <pthread.h>我使用这个cmd进行静态编译:
gcc -pthread bus.c ../nanomsg/.libs/libnanomsg.a -o test -lanl请注意行尾的-pthread和-lanl。
发布于 2014-02-14 08:17:11
尝试以下几点:
$ sudo updatedb
$ locate libc.h找到libc.h所在的路径。如果你的libc.h是/usr/local/include
gcc -I/usr/local/include pipeline.c /usr/local/lib/libnanomsg.a -o pipelinehttps://stackoverflow.com/questions/21768542
复制相似问题