I am getting an error while compiling C file using gcc - It's giving error as no such file/directory is found for dce/rpc.h . where should I look for it ?
3 Answers
This command prints include paths:
gcc -xc -v -
In my linux box the result is the following:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i586-redhat-linux/4.4.1/include
/usr/include
End of search list.
With cross gcc, the path can be very difficult to quess:
#include <...> search starts here:
/opt/OSELAS.Toolchain-2011.11.0/arm-v5te-linux-gnueabi/gcc-4.6.2-glibc-2.14.1-binutils-2.21.1a-kernel-2.6.39-sanitized/lib/gcc/arm-v5te-linux-gnueabi/4.6.2/include
/opt/OSELAS.Toolchain-2011.11.0/arm-v5te-linux-gnueabi/gcc-4.6.2-glibc-2.14.1-binutils-2.21.1a-kernel-2.6.39-sanitized/lib/gcc/arm-v5te-linux-gnueabi/4.6.2/include-fixed
/opt/OSELAS.Toolchain-2011.11.0/arm-v5te-linux-gnueabi/gcc-4.6.2-glibc-2.14.1-binutils-2.21.1a-kernel-2.6.39-sanitized/lib/gcc/arm-v5te-linux-gnueabi/4.6.2/../../../../arm-v5te-linux-gnueabi/include
/opt/OSELAS.Toolchain-2011.11.0/arm-v5te-linux-gnueabi/gcc-4.6.2-glibc-2.14.1-binutils-2.21.1a-kernel-2.6.39-sanitized/sysroot-arm-v5te-linux-gnueabi/usr/include
End of search list
So don't try to quess or find it, you may get a wrong path.
Comments
You can find out which directories gcc will search in for include files by default, by running the preprocessor (cpp) with the -v option. You also should specify which language you're interested in, unless it's C, since each language has its own search path.
Here's an example:
cpp -v -x c++ < /dev/null
Note that you have to specify that there is no file to preprocess; otherwise, it will try reading from stdin.
The above shows the default include path for c++.
Comments
Start at /usr/include and work down from there, assuming it's a system header. Most system header files are stored there under UNIX/Linux systems.
If it's not a system header, it will be wherever you (or another third party) have put it (could be anywhere really). If you want to find it, you could do something like (for xyzzy.h):
find / -name xyzzy.h 2>/dev/null
If you can't find the headers you expect then it's probably not installed on your system. You'll need to figure out how to do that. For example, The Open Group has an LGPL-style DCE implementation that you could use under Linux.
Depending on your platform (AIX, HP-UX, Solaris, etc), it may be a simple matter of installing a package.
-Ioptions togcc, and you may want to use<rpc/rpc.h>dce/rpc.hwill be DCE == Distributed Computing Environment, since that's the Remote Procedure Call thing.