I am using Intel's System Studio on an embedded Fedora 14 64-bit OS. I have sourced the iccvars.sh and installed the "Deployment Tools" so the compiler's tools and enviroment should be set up completely. I am attempting to compile a fairly compley .c file that contains several headers. I used the -H command to see that the compiler is locating these one by one from various spots. For some reason or another, it cannot open this particular source file. I used the find funtion to locate Priorities.h on my machine and have found it to be in just a slightly different location. Would the location be the source of my problems or is there another problem. I'm happy to share more specifics if it will help you answer my question, thank you in advance for the help.
From your statement above, the compiler is looking for priorities.h in the wrong place. Here are a few questions we need to answer to in order to determine why.
1) Where is the compiler looking for the file?
2) Where actually is the file? Have you found it?
3) Where is the header file in relation to the calling source file?
4) What does the include line in the source file look like?
Let me know, thanks.
1)I'm not really sure on how to check where it is looking for the file but here is what I'm getting:
[root@localhost ptl_FIle]# icpc PTL_Main.c -H
PTL_Main.c(8): catastrophic error: cannot open source file "Priorities.h"
compilation aborted for PTL_Main.c (code 4)
2) Yes, i have found the file, it's located at:
3&4) #include "Priorities.h", is the first file included in the labeled section "User includes", which is after what the "system includes" (signal.h, string.h, stdio.h, & unistd.h). After calling for Priorities.h the file goes on to include some odd 25 .h files, none of which have be sourced by the compiler as they follow Priorites.h, but they are in a similar path so i fear that they won't be able to be sourced either. I'm thinking now that these files might need to be be in the directory /usr/... like the other .h files, but im not sure.
icc uses the same way as gcc to find the path for include files. For this case, you may just add option "-I/home/twain/Desktop/PTL/PhaseII/code/PTL/Tasking/" to specify the inlcude path for Priorities.h explicitly.
See http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html for your reference.
GCC looks in several different places for headers. On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with #include <file> in:
For C++ programs, it will also look in libdir/../include/c++/version, first. In the above, target is the canonical name of the system GCC was configured to compile code for; often but not always the same as the canonical name of the system it runs on. version is the version of GCC in use.
You can add to this list with the -Idir command line option. All the directories named by -I are searched, in left-to-right order, before the default directories. The only exception is when dir is already searched by default. In this case, the option is ignored and the search order for system directories remains unchanged.
Thank you for the help, I was able to use the -I function. In order for the compiler to find all the.h files it needs to run the program I had to put all the non-defaulted .h files in one folder so the path following -I would lead to whatever file it was looking for. Thank you once again for the help and the rapid response.