changing include directories - /usr/local/include
So I have been having some troubles installing libvorbis and SDL_mixer (both in order to get the Wesnoth game working) - and it seems as if include files in /usr/local/include are not being found by my compiler. When compiling SDL_mixer, it tells me that a certain variables is undeclared, and I have found this variable to be declared in a libvorbis header file which is installed by libvorbis into /usr/local/include. Is it possible that my compiler is not looking for include files in /usr/local/include? And how can I change this?
Is it safe to simply copy all the include files in /usr/local/include into /usr/include? I have tried stuff like this before, and sometimes it can be very damaging. Thanks in advance, Matthew |
I've never built Wesnoth, but it probably uses pkg-config to find dependencies. The metadata file for libvorbis will tell Wesnoth where to look for headers. This is the metadata file for libvorbis on my machine.
Code:
# libvorbis pkg-config source file Code:
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" |
Thanks for the quick reply - I appreciate it. But I am not using pkg-config. I am not sure how or if I could do this - as my Linux system has no direct access to the internet. Instead, I am trying to install wesnoth using the source package off its website. But the problem I am actually having, I think, is installing libSDL_mixer and libvorbisfile.
So I think the issue is with where gcc make is looking for include files (?). |
Okay, I think I'm finding something. I may need a new version of gcc (though I know I have a 3.x version...)
http://gcc.gnu.org/ml/gcc/1999-07n/msg00973.html |
pkg-config is a helper utility that is found on most Linux systems.
|
Changing the gcc version probably won't solve the include issue. The compiler looks in certain places for header filer files, e.g. /usr/include and IIRC does not look in /usr/local/include by default. You can do:
export CFLAGS="-I /usr/local/include" to tell gcc it needs to look in /usr/local/include for headers. However, I've occasionally found CFLAGS to be overwritten by the configure script so there may be another way to pass the include directory to configure (check ./configure --help and see if there is such an option). You are also probably going to need to add /usr/local/lib to your library path assuming there are libraries in that idrectory that need to be linked against. Usually you can append this to your LD_LIBRARY_PATH. |
Hi, sorry, I was wrong. I just recompiled a few dependencies, and it started working. I did copy a few include files from /usr/local/include to /usr/include, so this might have been the issue. I will try your advice, in case this was the issue.
|
All times are GMT -5. The time now is 08:00 PM. |