-1

I have the following test.cpp file :

#include <unistd>

int   main()
{
    return 0;
}

I just want to compile this but I still have the following :

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

I found unistd.h at /usr/include/unistd.h. and my $LD_LIBRARY_PATH environment variable was empty so I set it at /usr/include (with export LD_LIBRARY_PATH=/usr/include) but the problem remains. What could I do?

vmonteco
  • 14,136
  • 15
  • 55
  • 86

1 Answers1

1

The name of the header is unistd.h, not unistd. And LD_LIBRARY_PATH is used to locate shared libraries, not header files.