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 ?
-
1Check whether the file is really there? Without information of what exactly is missing (your file or some other thing), it's hard to say anything – nhahtdh Oct 10 '12 at 05:31
-
You need additional `-I` options to `gcc`, and you may want to use `
` – Basile Starynkevitch Oct 10 '12 at 05:43 -
These days, not every system will have DCE (Desktop Computing Environment — for Motif, etc, from the glory days of OSF/1 etc) on the system. Is the code new or old? Does it come with instructions for where to find DCE for your platform (and what is your platform)? (GCC looks in different places on different platforms. Primarily, it looks in /usr/include; where else it looks depends on how it was configured.) – Jonathan Leffler Oct 10 '12 at 06:05
-
@JonathanLeffler, actually `dce/rpc.h` will be DCE == Distributed Computing Environment, since that's the Remote Procedure Call thing. – paxdiablo Oct 10 '12 at 06:12
-
@paxdiablo Baah—It's so long since I came across DCE I'd forgotten what it was an acronym for. You're right; it is Distributed (Computing Environment), not Desktop. – Jonathan Leffler Oct 10 '12 at 06:14
-
http://stackoverflow.com/questions/344317 – Drew Dormann Dec 22 '12 at 22:52
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.

- 8,007
- 2
- 26
- 57
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++.

- 234,347
- 28
- 237
- 341
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.

- 854,327
- 234
- 1,573
- 1,953
-
-
1Then that would explain the errors. DCE would almost certainly be under /usr/include somewhere if it were installed. You'll need to find out how to get it installed (initially by telling us the platform you're using). – paxdiablo Oct 10 '12 at 05:41
-
It's not in /usr/include . Had it been there it would have located it . I am using Unix machine but does that reflect it is not installed . I did find / -name 'dce/rpc.h' 2>/dev/null but it did not return anything – Programah Oct 10 '12 at 05:56
-
1@user1634951, You would use rpc.h rather than dce/rpc.h in the find command. – paxdiablo Oct 10 '12 at 06:13
-
Oh yea Thanks ! I could find rpc.h in /usr/include/rpc/rpc.h but then why it is giving error as file or directory cannot be found . do i need to use any other option. – Programah Oct 10 '12 at 06:21
-
-
@user1634951, RPC is simply remote procedure calls, the ability to call a function in an totally different process/machine. DCE is an implementation of RPC. Whether the rpc/rpc.h file on your system provides a DCE-compatible RPC, I don't know. – paxdiablo Oct 10 '12 at 06:56