PIDL generated headers in librpc/gen_ndr/

David Disseldorp ddiss at samba.org
Tue Aug 22 23:28:52 UTC 2017


Hi Dimitris,

On Tue, 22 Aug 2017 22:33:37 +0300, Dimitris Gravanis wrote:

> If I read this output correctly, i appears that PIDL-generated 
> default/librpc/gen_ndr/misc.h and default/librpc/gen_ndr/dnsp.h don't 
> include libcli/util/data_blob.h and libcli/util/time.h when compiled:
> 
> |In file included from default/librpc/gen_ndr/dns.h:10:0,||
> ||                 from ../source4/dns_server/dns_server.h:25,||
> ||                 from ../libcli/dns/libtcp.h:27,||
> ||                 from ../libcli/dns/cli_dns.c:32:||
> ||default/librpc/gen_ndr/misc.h:98:2: error: unknown type name ‘DATA_BLOB’||
> ||  DATA_BLOB binary;/* [case(REG_BINARY),flag(LIBNDR_FLAG_REMAINING)] ||
> ||  ^||

It looks as though the failures are due to the order of your includes
here - if you look at unwind you'll see that it's encountered at:
cli_dns.c (line 32), which includes...
  libtcp.h (line 27), which includes...
    dns_server.h (line 25), which includes...
      dns.h (line 10), which includes...
        misc.h (line 90), which is where DATA_BLOB is an "unknown type"

This means that at this point, the compiler was yet to see a declaration
of DATA_BLOB. This declaration is, as you've found, present in
lib/util/data_blob.h , so it should just be a matter of moving the
data_blob.h #include up above this code path.

...
> Adding
> 
> |#include "lib/util/data_blob.h"||
> ||#include "lib/util/time.h"|
> 
> to libtsig.h (included in cli_dns.c) didn't do the trick, nor including 
> them directly in cli_dns.

libtsig.h is included by cli_dns.c *after* libtcp.h, which is why it
didn't help here.

Cheers, David



More information about the samba-technical mailing list