【问题标题】:unistd : no such file or directory [closed]unistd:没有这样的文件或目录[关闭]
【发布时间】:2016-12-11 21:25:14
【问题描述】:

我有以下test.cpp 文件:

#include <unistd>

int   main()
{
    return 0;
}

我只想编译这个,但我还有以下内容:

$ g++ test.cpp
test.cpp:1:18: fatal error: unistd: No such file or directory
 #include <unistd>
                  ^
compilation terminated.

我在/usr/include/unistd.h 找到了unistd.h。我的$LD_LIBRARY_PATH 环境变量是空的,所以我将它设置为/usr/include(使用export LD_LIBRARY_PATH=/usr/include),但问题仍然存在。 我能做什么?

【问题讨论】:

    标签: c++ unistd.h


    【解决方案1】:

    标头的名称是unistd.h,而不是unistd。并且 LD_LIBRARY_PATH 用于定位共享库,而不是头文件。

    【讨论】:

    • 我的错,你是对的。
    猜你喜欢
    • 1970-01-01
    • 2021-09-30
    • 1970-01-01
    • 1970-01-01
    • 2013-05-13
    • 1970-01-01
    • 1970-01-01
    • 2012-07-08
    相关资源
    最近更新 更多