Build error of NSD4 on Debian Squeeze

Hello World,

I am trying to build NSD4 on Debian Squeeze and I get the following
errors when running `make`.

$ pwd
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5
$ make 
[... output omitted ...]
gcc -g -O2  -o nsd-checkconf answer.o axfr.o buffer.o configlexer.o
configparse
acket.o query.o rbtree.o radtree.o rdata.o region-allocator.o tsig.o
tsig-opens
4_pton.o b64_ntop.o -lcrypto
configparser.o: In function `c_parse':
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5/configparser.c:609: undefined
reference
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5/configparser.c:1358: undefined
reference
options.o: In function `parse_options_file':
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5/options.c:144: undefined
reference to `c
collect2: ld returned 1 exit status
make: *** [nsd-checkconf] Error 1

I have done the following:

# Install prerequisites

    $ sudo aptitude install subversion libssl-dev autoconf make byacc
    flex bison build-essential -y

# Clone NSD Repository

    $ mkdir $HOME/src
    $ cd $HOME/src
    $ svn co http://www.nlnetlabs.nl/svn/nsd/ nsd

# Generate `configure` program

    $ cd $HOME/src/nsd/tags/NSD_4_0_0_imp_5
    $ autoreconf --install

# Configure

    $ cd $HOME/src/nsd/tags/NSD_4_0_0_imp_5
    $ ./configure --prefix=/usr --sysconfdir=/etc/nsd4
    --localstatedir=/var/run/nsd4 --with-configdir=/etc/nsd4
    --with-nsd_conf_file=/etc/nsd4/nsd4.conf -
    -with-pidfile=/var/run/nsd4/nsd4.pid

I could use some help on this matter. Thank you.

Cheers and Goodwill,
v

Hi Valentin,

Hello World,

I am trying to build NSD4 on Debian Squeeze and I get the
following errors when running `make`.

What is the last word on these lines (not capped at 80 characters)? I
want the know 'undefined reference to x' what that function x is.

If your xterm does not work well; perhaps pipe it to a file.

Best regards,
   Wouter

Hi Wouter,

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

Hi Valentin,

> Hello World,
>
> I am trying to build NSD4 on Debian Squeeze and I get the
> following errors when running `make`.

What is the last word on these lines (not capped at 80 characters)? I
want the know 'undefined reference to x' what that function x is.

Just now I have noticed that the lines are capped at 80 characters.

The output of `make` is the following:

$ pwd 
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5
$ make
[... output omitted ...]
gcc -g -O2  -o nsd-checkconf answer.o axfr.o buffer.o configlexer.o
configparser.o dname.o dns.o edns.o iterated_hash.o lookup3.o namedb.o
nsec3.o options.o packet.o query.o rbtree.o radtree.o rdata.o
region-allocator.o tsig.o tsig-openssl.o udb.o udbradtree.o udbzone.o
util.o nsd-checkconf.o strlcat.o strlcpy.o b64_pton.o b64_ntop.o
-lcrypto
configparser.o: In function `c_parse':
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5/configparser.c:609: undefined
reference to `c_lex'
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5/configparser.c:1358: undefined
reference to `c_lex'
options.o: In function `parse_options_file':
/home/wiz/src/nsd/tags/NSD_4_0_0_imp_5/options.c:144: undefined
reference to `c_in'
collect2: ld returned 1 exit status
make: *** [nsd-checkconf] Error 1

If your xterm does not work well; perhaps pipe it to a file.

I guess tmux screwed things up when I copied from one pane to another.
Now I have read 3 times the above output just to be sure it includes
what you've asked :-).

Cheers and Goodwill,
v

Hi Valentin,

The routine c_lex and c_in should be from configlexer.o
this file is compiled from configlexer.c
this file is generated from configlexer.lex

That generation is performed with flex. Something is wrong with lex
or flex?

If you delete configlexer.c, configlexer.o, and make again; what is
the output? Does configlexer.c start with #include "configyyrename.h" ?

Best regards,
   Wouter

Hi Wouter,

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

Hi Valentin,

The routine c_lex and c_in should be from configlexer.o
this file is compiled from configlexer.c
this file is generated from configlexer.lex

That generation is performed with flex. Something is wrong with lex
or flex?

If you delete configlexer.c, configlexer.o, and make again; what is
the output? Does configlexer.c start with #include "configyyrename.h" ?

I am going to write the exact steps I did:

$ make clean
$ rm configlexer.c (configlexer.o was removed by `make clean`)
$ make
$ head -1 configlexer.c
#include "configyyrename.h"

It works :-). NSD4 compiled successfully.

I guess this happened because I have tried to compile NSD4 before
installing flex. So the configlexer.c was created when flex was missing
and did not include `configyyrename.h` or something like that.

Thank you for your time and help Wouter.
Cheers and Goodwill,
v