2

I am not able to locate a particular header file on disk, while my compiler (icpc) includes it without any errors.

How can I find the header file?

I tried querying the preprocessor for the header file locations as suggested here.

First of all, icpc does not report its preprocessor. Secondly, I cannot find the header file in cc1's locations as well.

Community
  • 1
  • 1
Lazer
  • 90,700
  • 113
  • 281
  • 364
  • If you're using an IDE, most of them have an option to open an included file if you right click on the file name in the `#include` statement. Once the file is open, you should be able to hover over the file tab, or use the File -> Save As option, to figure out the file path. – Praetorian Sep 03 '12 at 01:39
  • 3
    Maybe they're not on the disk :-) The standard doesn't actually mandate that. They could be hardcoded into the compiler, extracted from an HTTP transaction to Intel's web site, even stored on Voyager 1 and you have to go through NASA to compile your code (a rather slow process, due to the 32-hour lead time (out and back) for getting the header file back from eighteen billion kilometers away). – paxdiablo Sep 03 '12 at 01:39
  • I never though aliens wound need to know that char is one byte. – Cole Tobin Sep 03 '12 at 01:51

2 Answers2

3

Look in your compiler for and option, similar to /P in MSVC:

http://msdn.microsoft.com/en-us/library/8z9z0bx6(v=vs.80).aspx

Kirill Kobelev
  • 10,252
  • 6
  • 30
  • 51
  • Yes, `-P` and `-E` options are there. But they do not report *where* the file was found. – Lazer Sep 03 '12 at 01:28
  • I remember MSVC can show these names, I cannot find this key. Study the keys of your compiler. – Kirill Kobelev Sep 03 '12 at 01:30
  • For gcc I'm pretty sure the preprocessed file contains the full path name in `# ...` lines. For gcc you can also have a look at the output produced with the `-M` option: this creates dependencies suitable for `make` and definitely includes the information to locate the file, although possibly relative to the current directory. – Dietmar Kühl Sep 03 '12 at 01:36
0

Usually you can find it in the path you installed your compiler, say if you installed mingw at C:\MingW, then the include files will be at C:\MinGW\include so go and search the path you installed icpc will help I think:)

shengy
  • 9,461
  • 4
  • 37
  • 61
  • No, they are being used from a remote location through a complex expansion of environment variables. – Lazer Sep 03 '12 at 01:27
  • Well, if I am facing this problem, I'll probably use Everything to find it. http://www.voidtools.com/download.php – shengy Sep 03 '12 at 01:28