I set them properly, but it seems that gcc isn't using them. Is there a switch I should use?
I'm saying this because I compiled a gtk example (on Windows) and if I set the list of directories in the two environment variables, gcc complains about missing header files, but if I pass the directories with, respectively, -I and -L everything works perfectly
-I\blah\ for include and -Lblah for library path.
[edit] Didnt read your part where you said -I and -L you used.
but if I pass the directories with, respectively, -I and -L everything works perfectly
See my edit
Isn't the library env var LD_SEARCH_PATH? I don't recall exactly what it its, but I remember the LD_ and I don't think LIBRARY was a part of it.
There's also some config file (ascii) somewhere that tells gcc where the default stuff is, I remember fiddling with it so I could have my own libraries & headers separate from the default locations. IIRC, putting the -v switch in while compiling something will show this process and which file tells it to look where for include & lib.
I finally found it in the docs
LIBRARY_PATH
The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH. When configured as a native compiler, GCC tries the directories thus specified when searching for special linker files, if it can't find them using GCC_EXEC_PREFIX. Linking using GCC also uses these directories when searching for ordinary libraries for the -l option (but directories specified with -L come first).
And I remember this one...
CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH
Each variable's value is a list of directories separated by a special character, much like PATH, in which to look for header files. The special character, PATH_SEPARATOR, is target-dependent and determined at GCC build time. For Windows-based targets it is a semicolon, and for almost all other targets it is a colon.
CPATH specifies a list of directories to be searched as if specified with -I, but after any paths given with -I options on the command line. The environment variable is used regardless of which language is being preprocessed.
The remaining environment variables apply only when preprocessing the particular language indicated. Each specifies a list of directories to be searched as if specified with -isystem, but after any paths given with -isystem options on the command line.
I didn't recall these, maybe they're new?
However, after setting CPATH and LIBRARY_PATH I got everything working again. Woo
There's LD_LIBRARY_PATH and several other LD_ environment variables (LD_SEARCH_PATH may be there as well, don't know). These are for the loader (linker for Windows people) and specify directories where shared objects are looked for.
There's LD_LIBRARY_PATH and several other LD_ environment variables (LD_SEARCH_PATH may be there as well, don't know). These are for the loader (linker for Windows people) and specify directories where shared objects are looked for.
To which version are you referring to? I can't find them in the docs I have (could be... the ones I have are for gcc 3.2.3 , going to update them)
[edit]
Just updated to the docs for gcc 3.4.4, but I can't find any page on LD_* environment variables
LD_LIBRARY_PATH is documented in the documentation for ld, not gcc. Not too well documented though; I'm sure there must be a better place where it's documented, but I'm not sure where.