Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

dnscap.c:356: error: 'ns_r_noerror' undeclared here (not in a function) #82

Closed
jungle-boogie opened this issue Jun 7, 2017 · 7 comments

Comments

@jungle-boogie
Copy link

Hi All,

What's up with the undeclared functions?
Using openBSD -current with dnscap from git master.
amd64

$ make
Making all in src
make  all-recursive
Making all in test
depbase=`echo dnscap.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; gcc -DHAVE_CONFIG_H -I.     -I.  -I..     -I/usr/local/include -MT dnscap.o -MD -MP -MF $depbase.Tpo -c -o dnscap.o dnscap.c && mv -f $depbase.Tpo $depbase.Po
dnscap.c:356: error: 'ns_r_noerror' undeclared here (not in a function)
dnscap.c: In function 'parse_args':
dnscap.c:1031: error: 'ns_r_formerr' undeclared (first use in this function)
dnscap.c:1031: error: (Each undeclared identifier is reported only once
dnscap.c:1031: error: for each function it appears in.)
dnscap.c:1032: error: 'ns_r_servfail' undeclared (first use in this function)
dnscap.c:1033: error: 'ns_r_nxdomain' undeclared (first use in this function)
dnscap.c:1034: error: 'ns_r_notimpl' undeclared (first use in this function)
dnscap.c:1035: error: 'ns_r_refused' undeclared (first use in this function)
dnscap.c: In function 'prepare_bpft':
dnscap.c:1435: error: 'ns_o_update' undeclared (first use in this function)
dnscap.c:1438: error: 'ns_o_notify' undeclared (first use in this function)
dnscap.c: In function 'dl_pkt':
dnscap.c:1858: error: 'NS_INT32SZ' undeclared (first use in this function)
dnscap.c: In function 'network_pkt':
dnscap.c:2432: error: 'ns_o_query' undeclared (first use in this function)
dnscap.c:2433: error: 'ns_o_update' undeclared (first use in this function)
dnscap.c:2434: error: 'ns_o_notify' undeclared (first use in this function)
dnscap.c: In function 'in_checksum':
dnscap.c:2954: error: 'NS_INT16SZ' undeclared (first use in this function)
*** Error 1 in src (Makefile:530 'dnscap.o')
*** Error 1 in src (Makefile:630 'all-recursive')
*** Error 1 in src (Makefile:402 'all')
*** Error 1 in /home/sean/bin/dnscap (Makefile:464 'all-recursive')
@jelu
Copy link
Member

jelu commented Jun 7, 2017

Looks like you need libbind for OpenBSD. These are defined in arpa/nameser.h on Linux and included in libc6 (for example in libc6-dev under Ubuntu), libbind brings it's own includes. There is an issue (#11) to remove the dependency on libbind but it's low priority.

@jelu jelu closed this as completed Jun 7, 2017
jelu added a commit to jelu/dnscap that referenced this issue Jun 7, 2017
@jungle-boogie
Copy link
Author

Hi @jelu,

I've installed libbind and it's found at /usr/local/lib/libbind/.

My env flag is as show in the readme:
env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure

The same build fail is happening, though.

@raybellis
Copy link

raybellis commented Jun 7, 2017

Those env settings look more appropriate for if you had installed libbind in /usr/local/ such that the headers went directly into /usr/local/include and the actual library files (.a and/or .so)
into /usr/local/lib and not a subdirectory thereof.

@jungle-boogie
Copy link
Author

@raybellis,

you mean like this?

$ ls -l /usr/local/include/bind/
total 144
drwxr-xr-x  2 root  wheel    512 Jun  7 11:53 arpa
-rw-r--r--  1 root  bin      236 Jun  6 17:49 fd_setsize.h
-rw-r--r--  1 root  bin     1489 Jun  6 17:49 hesiod.h
-rw-r--r--  1 root  bin     3473 Jun  6 17:49 irp.h
-rw-r--r--  1 root  bin    12210 Jun  6 17:49 irs.h
drwxr-xr-x  2 root  wheel    512 Jun  7 11:53 isc
-rw-r--r--  1 root  bin    19745 Jun  6 17:49 netdb.h
-rw-r--r--  1 root  bin      616 Jun  6 17:49 netgroup.h
-rw-r--r--  1 root  bin     2450 Jun  6 17:49 res_update.h
-rw-r--r--  1 root  bin    19969 Jun  6 17:49 resolv.h
drwxr-xr-x  2 root  wheel    512 Jun  7 11:53 sys
$ ls -l /usr/local/lib/libbind/
total 2148
-rw-r--r--  1 root  bin  665816 Jun  6 17:49 libbind.a
-rw-r--r--  1 root  bin     723 Jun  6 17:49 libbind.la
-rw-r--r--  1 root  bin  377719 Jun  6 17:49 libbind.so.5.0

@raybellis
Copy link

right, so you need CFLAGS=-I/usr/local/include/bind LDFLAGS=-L/usr/local/lib/libbind

@jungle-boogie
Copy link
Author

Okay, got it working!

env CFLAGS="-I/usr/local/include -I/usr/local/include/bind" LDFLAGS="-L/usr/local/lib -L/usr/local/lib/libbind" ./configure

I needed to tell it where bind/libbind are as well as pcap.

@raybellis
Copy link

Glad it's working - it's kind of unusual to have a package installed into particular subdirectories of /usr/local/include and /usr/local/lib.

jelu added a commit that referenced this issue Jun 8, 2017
Fix #82: Update dependencies for OpenBSD
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants