Wireshark-users: Re: [Wireshark-users] fatal error: krb5.h: No such file or directory
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 20 Apr 2018 13:35:59 -0700
On Apr 18, 2018, at 8:48 PM, jungle boogie <jungleboogie0@xxxxxxxxx> wrote:

> Thus said Guy Harris on Wed, 18 Apr 2018 20:20:35 -0700
>> What does
>> 	apt list --installed | egrep krb5
> 
> 
> krb5-locales/xenial-updates,xenial-updates,now 1.13.2+dfsg-5ubuntu2 all [installed]
> krb5-multidev/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]
> libgssapi-krb5-2/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]
> libkrb5-26-heimdal/xenial-updates,xenial-security,now 1.7~git20150920+dfsg-4ubuntu1.16.04.1 amd64 [installed,automatic]
> libkrb5-3/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]
> libkrb5support0/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]

On my Ubuntu 16.04 VM, I have

krb5-locales/xenial-updates,xenial-updates,now 1.13.2+dfsg-5ubuntu2 all [installed,automatic]
krb5-multidev/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed]
libgssapi-krb5-2/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]
libkrb5-26-heimdal/xenial-updates,xenial-security,now 1.7~git20150920+dfsg-4ubuntu1.16.04.1 amd64 [installed,automatic]
libkrb5-3/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]
libkrb5-dev/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed]
libkrb5support0/xenial-updates,now 1.13.2+dfsg-5ubuntu2 amd64 [installed,automatic]

*and* I have /usr/include/krb5.h.

I *suspect* the difference is the libkrb5-dev package; it may be that krb5-multidev avoids installing (MIT) Kerberos headers directly in /usr/include to avoid colliding with Heimdal Kerberos headers.

On Apr 19, 2018, at 11:51 AM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

> No sign of "-isystem /usr/include/mit-krb5" in those compiler flags, so Wireshark's CMake files are broken - they're not adding Kerberos's compiler flags.  Works fine if the header is in /usr/include or /usr/local/include, not so fine if it's not, as on your Ubuntu machine.
> 
> I'll see if I can figure out what it should be doing.

From a quick look at the definition of pkg_search_module in CMake 3.5.1, it does *NOT* check for -isystem in the output of pkg-config --cflags, it only checks for -I and --cflags-only-I.

So perhaps what we have to do with *any* package found with pkg-config is to use *all* of <XPREFIX>_CFLAGS, rather than using <XPREFIX>_INCLUDE_DIRS.  There might be other flags that pig-config supplies that might be necessary when compiling - presumably it wouldn't supply them if they weren't necessary or at least recommended.