Skip to contentSkip to conversation

Compiler method of finding header.

DISCUSSION Adam Luchjenbroers 5 participants 5 messages Oct 21, 2003 – Oct 22, 2003

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory

includes line:
#include <krb5.h>

So it's expecting the header to be wherever the compiler expects them.

using locate:
/usr/kerberos/include/krb5.h

How do I tell the compiler where to look for headers? OS is RedHat 9.

- --
"What happens if a big asteroid hits the Earth? Judging from realistic simulations involving a sledge hammer and a common laboratory frog, we can assume it will be pretty bad." - Dave Barry

Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/laTT94zI/zB2CYURAiGVAKCW7VWzAfZnwwLBZ/v8+3Mi9KNMSgCfZ+L+ n9lCD6pDbUq9YESC2XIyRzs=
=DC42
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 8 lines · Adam Luchjenbroers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory

includes line:
#include <krb5.h>

Quoted 7 lines

So it's expecting the header to be wherever the compiler expects them.

using locate:
/usr/kerberos/include/krb5.h

How do I tell the compiler where to look for headers? OS is RedHat 9.

Without knowing what you are trying to compile or being able to see the Makefile it would be hard to say how you could do that in the makefile as includes "include" header files that are located in /usr/include so your Makefile is not at fault here, or so it seems to me.

If this is a one file error then you could edit kssl.h and change the above mentioned include to;

#include </usr/kerberos/include/krb5.h>

I expect you would then find that your compile will go on a little and barf again as it will miss another file, you can also create a sym link in /usr/ include (possably a better idea).

cd /usr/include
ln -s /usr/kerberos/include kerberos
Or something to that effect.

The most likly explanation for the problem is that your kerberos includes have been installed one directory too high, header files belong in /usr/include and not in /usr, that is what i have been taught.

Signature · 15 lines
If the Linux community is a bunch of theives because they
try to imitate windows programs, then the Windows community
is built on organized crime.

Regards Richard
[email protected]
http://people.zeelandnet.nl/pa3gcu/



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#2 lore raw
In reply to Adam Luchjenbroers
Quoted 11 lines · Adam Luchjenbroers

/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory

includes line:
#include <krb5.h>

So it's expecting the header to be wherever the compiler expects them.

using locate:
/usr/kerberos/include/krb5.h

How do I tell the compiler where to look for headers? OS is RedHat 9.

Hi,
I am not quite sure I understand what you are trying to do here, but this might help.

If you put something like

#include <foobar.h>

in a source file, then the compiler looks for foobar.h in the default location(s) - usually /usr/include.
If you put something like

#include "/home/me/include/foobar.h"

in the source, the the compiler looks for that specific file. Note that the first example uses angle brackets <> and the second uses double quotes.
So you might try something like:

#include "/usr/kerberos/include/krb5.h"

You second option is to add /usr/kerberos/include/ to the list of places checked for include files. You can do this on the command line for gcc with to option:

gcc -I/usr/kerberos/include/ something.c

You are probably using a Makefile, so you would have to hack that to make it (the -I option) work.

I hope this helps.

regards,

John Kelly
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#3 lore raw
In reply to Adam Luchjenbroers

if you asking how to permanently change your include folder, I have to admit that I don't actually know. but if you just want it to search a particular directory at compile time you use the -I option

for instance if I want gcc to look in the /home/mydir/include folder I would type

gcc file.c -I /home/mydir/include

Quoted 31 lines · Adam Luchjenbroers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory

includes line:
#include <krb5.h>

So it's expecting the header to be wherever the compiler expects them.

using locate:
/usr/kerberos/include/krb5.h

How do I tell the compiler where to look for headers? OS is RedHat 9.

- --
"What happens if a big asteroid hits the Earth? Judging from realistic simulations involving a sledge hammer and a common laboratory frog, we can assume it will be pretty bad." - Dave Barry

Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/laTT94zI/zB2CYURAiGVAKCW7VWzAfZnwwLBZ/v8+3Mi9KNMSgCfZ+L+ n9lCD6pDbUq9YESC2XIyRzs=
=DC42
-----END PGP SIGNATURE-----

Quoted 5 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#4 lore raw
In reply to Adam Luchjenbroers
Quoted 10 lines

/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory

includes line:
#include <krb5.h>

So it's expecting the header to be wherever the compiler expects them.

using locate: /usr/kerberos/include/krb5.h

How do I tell the compiler where to look for headers? OS is RedHat 9.

Short answer:
Add "-I/usr/kerberos/include" to your GCC command.

Long answer:

This looks like a problem with kssl.h expecting a file to be located in the "standard search path" for gcc but it is not.

To see the standard search path for includes do this:
cpp -v

On my machine I get this:
[driver@mulan ~/junk]$ cpp -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib Thread model: posix
gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/cpp0 -lang-c -v
-D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__ -D__tune_pentium__ -
GNU CPP version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk) (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/usr/i586-mandrake-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/include
/usr/include
End of search list.

The important part is at the bottom - I cut/paste the important part:
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/include /usr/include
End of search list.

So the default search path for files that are "#include <...>" is:
/usr/local/include /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/include /usr/include

If you want to ADD a directory to this when you run gcc pass "-I". You can do a test with cpp:
[driver@mulan ~/junk]$ cpp -v -I/usr/X11R6/include
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib Thread model: posix
gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/cpp0 -lang-c -v
-I/usr/X11R6/include/ -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__ -D__tune_pentium__ - GNU CPP version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk) (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/usr/i586-mandrake-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/X11R6/include
/usr/local/include
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/include
/usr/include
End of search list.

Notice the search list now includes /usr/X11R6/include as I added it with the -I.

Remember if you pass a direcory that doesn't exist, or you cannot access it will be listed before the directories with an error. A standard mandrake install has one already compiled in... It's this:
ignoring nonexistent directory "/usr/i586-mandrake-linux-gnu/include"

Note: cpp is the C pre-proccessor that gcc will call. -I works the same in both.

Signature · 10 lines
Bryan Whitehead
SysAdmin - JPL - Interferometry and Large Optical Systems
Phone: 818 354 2903
[email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs