# Errors compiling bro-pub-0.8a32 on Linux 2.4.20-8

**URL:** https://community.zeek.org/t/errors-compiling-bro-pub-0-8a32-on-linux-2-4-20-8/387
**Category:** Zeek
**Created:** [July 12, 2003, 3:20pm UTC](https://community.zeek.org/t/errors-compiling-bro-pub-0-8a32-on-linux-2-4-20-8/387 "2003-07-12T15:20:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Christopher\_Jay\_Mand](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@Christopher\_Jay\_Mand](https://community.zeek.org/u/Christopher_Jay_Mand)
#### Post date: [July 12, 2003, 3:20pm UTC](https://community.zeek.org/t/errors-compiling-bro-pub-0-8a32-on-linux-2-4-20-8/387/1 "2003-07-12T15:20:33Z")

</div>

Hi,

Just thought I would note that for several versions of Linux, the compile does not work out of the box. Not just kernel 2.4.20-8. But, this is the one I am going to do some testing on.

I will be doing my IDS testing on:  
1 - FreeBSD 4.6.2  
1 - OpenBSD 2.9  
1 - Linux 2.4.20-8

Anyway, the configure goes ok on Linux, but the initial make gets the errors below. I hope they are useful to get the autoconf stuff setup right for the next release.

If you can offer where to fix this, I'd be happy. Otherwise, if I get a chance I'd figure that out and send the fix. At first glance it looks like the static use of the linux-includes does not scale past some certain Linux version.

HTH

Chris

The problems start here:  
g++ -I. -Ilibedit -O -Ilinux-include -c main.cc  
g++ -I. -Ilibedit -O -Ilinux-include -c net\_util.cc  
g++ -I. -Ilibedit -O -Ilinux-include -c util.cc  
util.cc: In function `void init\_random\_seed()':  
util.cc:395: `uint32\_t' undeclared (first use this function)  
util.cc:395: (Each undeclared identifier is reported only once for each  
&nbsp;&nbsp;&nbsp;&nbsp;function it appears in.)  
util.cc:395: parse error before `[' token  
util.cc:399: `buf' undeclared (first use this function)  
util.cc:427: parse error before `=' token  
util.cc:430: `result' undeclared (first use this function)  
make: \*\*\* [util.o] Error 1

Full log:  
Unpacking libedit sources  
Building libedit.a  
creating cache ./config.cache  
checking for gcc... gcc  
checking whether the C compiler (gcc ) works... yes  
checking whether the C compiler (gcc ) is a cross-compiler... no  
checking whether we are using GNU C... yes  
checking whether gcc accepts -g... yes  
checking for gawk... gawk  
checking for a BSD compatible install... /usr/bin/install -c  
checking for dirent.h that defines DIR... yes  
checking for opendir in -ldir... no  
checking how to run the C preprocessor... gcc -E  
checking for ANSI C header files... yes  
checking for sys/wait.h that is POSIX.1 compatible... yes  
checking for limits.h... yes  
checking for malloc.h... yes  
checking for sys/ioctl.h... yes  
checking for unistd.h... yes  
checking for sys/cdefs.h... yes  
checking for sys/types.h... yes  
checking for working const... yes  
checking for size\_t... yes  
checking for working alloca.h... yes  
checking for alloca... yes  
checking whether gcc needs -traditional... no  
checking return type of signal handlers... void  
checking for re\_comp... yes  
checking for regcomp... yes  
checking for strdup... yes  
checking for strerror... yes  
checking for strstr... yes  
checking for strtol... yes  
checking for vis.h... no  
checking for strlcat... no  
checking for strlcpy... no  
checking for issetugid... no  
checking for fgetln... no  
checking for getline... yes  
checking for flockfile... yes  
updating cache ./config.cache  
creating ./config.status  
creating Makefile  
creating compat\_conf.h  
make[1]: Entering directory `/home/cmanders/bro-pub-0.8a32/libedit'  
sh ./makelist -h ./vi.c \> vi.h.tmp && \  
&nbsp;&nbsp;&nbsp;mv vi.h.tmp vi.h  
sh ./makelist -h ./emacs.c \> emacs.h.tmp && \  
&nbsp;&nbsp;&nbsp;mv emacs.h.tmp emacs.h  
sh ./makelist -h ./common.c \> common.h.tmp && \  
&nbsp;&nbsp;&nbsp;mv common.h.tmp common.h  
sh ./makelist -fh vi.h emacs.h common.h \> fcns.h.tmp && \  
&nbsp;&nbsp;&nbsp;mv fcns.h.tmp fcns.h  
sh ./makelist -bh ./vi.c ./emacs.c ./common.c \> help.h.tmp && \  
&nbsp;&nbsp;&nbsp;mv help.h.tmp help.h  
sh ./makelist -bc ./vi.c ./emacs.c ./common.c \> help.c.tmp && \  
&nbsp;&nbsp;&nbsp;mv help.c.tmp help.c  
gcc -g -O2 -I. -I. -g -O0 -c chared.c  
gcc -g -O2 -I. -I. -g -O0 -c common.c  
gcc -g -O2 -I. -I. -g -O0 -c el.c  
gcc -g -O2 -I. -I. -g -O0 -c emacs.c  
sh ./makelist -fc vi.h emacs.h common.h \> fcns.c.tmp && \  
&nbsp;&nbsp;&nbsp;mv fcns.c.tmp fcns.c  
gcc -g -O2 -I. -I. -g -O0 -c fcns.c  
gcc -g -O2 -I. -I. -g -O0 -c hist.c  
gcc -g -O2 -I. -I. -g -O0 -c history.c  
gcc -g -O2 -I. -I. -g -O0 -c key.c  
gcc -g -O2 -I. -I. -g -O0 -c map.c  
gcc -g -O2 -I. -I. -g -O0 -c parse.c  
gcc -g -O2 -I. -I. -g -O0 -c prompt.c  
gcc -g -O2 -I. -I. -g -O0 -c read.c  
gcc -g -O2 -I. -I. -g -O0 -c refresh.c  
gcc -g -O2 -I. -I. -g -O0 -c search.c  
gcc -g -O2 -I. -I. -g -O0 -c sig.c  
gcc -g -O2 -I. -I. -g -O0 -c term.c  
gcc -g -O2 -I. -I. -g -O0 -c tokenizer.c  
gcc -g -O2 -I. -I. -g -O0 -c tty.c  
gcc -g -O2 -I. -I. -g -O0 -c vi.c  
gcc -g -O2 -I. -I. -g -O0 -c help.c  
gcc -g -O2 -I. -I. -g -O0 -c fgetln.c  
gcc -g -O2 -I. -I. -g -O0 -c readline.c  
gcc -g -O2 -I. -I. -g -O0 -c strlcpy.c  
ar -r libedit.a chared.o common.o el.o emacs.o fcns.o hist.o history.o key.o map.o parse.o prompt.o read.o refresh.o search.o sig.o term.o tokenizer.o tty.o vi.o help.o fgetln.o readline.o strlcpy.o  
make[1]: Leaving directory `/home/cmanders/bro-pub-0.8a32/libedit'  
bison -y -d -t -v builtin-func.y  
flex -obif\_lex.cc builtin-func.l  
g++ -o bif\_lex.o -c bif\_lex.cc  
g++ -o bif\_parse.o -c bif\_parse.cc  
g++ -o bif\_arg.o -c bif\_arg.cc  
g++ -I. -Ilibedit -O -Ilinux-include -o bifcl bif\_lex.o bif\_parse.o bif\_arg.o  
./bifcl event.bif  
./bifcl const.bif  
g++ -I. -Ilibedit -O -Ilinux-include -c main.cc  
g++ -I. -Ilibedit -O -Ilinux-include -c net\_util.cc  
g++ -I. -Ilibedit -O -Ilinux-include -c util.cc  
util.cc: In function `void init\_random\_seed()':  
util.cc:395: `uint32\_t' undeclared (first use this function)  
util.cc:395: (Each undeclared identifier is reported only once for each  
&nbsp;&nbsp;&nbsp;&nbsp;function it appears in.)  
util.cc:395: parse error before `[' token  
util.cc:399: `buf' undeclared (first use this function)  
util.cc:427: parse error before `=' token  
util.cc:430: `result' undeclared (first use this function)  
make: \*\*\* [util.o] Error 1

---

<div class="post-metadata">

### Author: ![Christopher\_Jay\_Mand](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@Christopher\_Jay\_Mand](https://community.zeek.org/u/Christopher_Jay_Mand)
#### Post date: [July 12, 2003, 4:19pm UTC](https://community.zeek.org/t/errors-compiling-bro-pub-0-8a32-on-linux-2-4-20-8/387/2 "2003-07-12T16:19:45Z")

</div>

I fixed this by adding:

#include \<elf.h\>

to the top of util.cc, since that is where uint32\_t is defined on my Linux....

That solved that problem. Then another cropped up in Dict.cc:

g++ -I. -Ilibedit -O -Ilinux-include -c Dict.cc  
Dict.cc: In member function `void\* Dictionary::NextEntry(HashKey\*&,  
&nbsp;&nbsp;&nbsp;&nbsp;IterCookie\*&, int) const':  
Dict.cc:260: choosing `HashKey::HashKey(const void*, int, unsigned int)' over `  
&nbsp;&nbsp;&nbsp;&nbsp;HashKey::HashKey(void\*, int, int)'  
Dict.cc:260: because worst conversion for the former is better than worst  
&nbsp;&nbsp;&nbsp;&nbsp;conversion for the latter  
Dict.cc:288: choosing `HashKey::HashKey(const void*, int, unsigned int)' over `  
&nbsp;&nbsp;&nbsp;&nbsp;HashKey::HashKey(void\*, int, int)'  
Dict.cc:288: because worst conversion for the former is better than worst  
&nbsp;&nbsp;&nbsp;&nbsp;conversion for the latter  
make: \*\*\* [Dict.o] Error 1

This error looks more programatic to fix, so this will take more time. Anyone with thoughts on this one?

Tx!

Chris

---

<div class="post-metadata">

### Author: ![Yann\_Berthier](https://avatars.discourse-cdn.com/v4/letter/y/bb73d2/32.png) [@Yann\_Berthier](https://community.zeek.org/u/Yann_Berthier)
#### Post date: [July 12, 2003, 7:26pm UTC](https://community.zeek.org/t/errors-compiling-bro-pub-0-8a32-on-linux-2-4-20-8/387/3 "2003-07-12T19:26:13Z")

</div>

Well, i fixed it by doing exactly what the compiler suggests:

--- work/bro-pub-0.8a32/Dict.cc Wed Apr 9 08:57:01 2003  
+++ /tmp/bro-pub-0.8a32/Dict.cc Thu Jun 26 14:37:51 2003  
@@ -257,7 +257,7 @@  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entry = (\*ttbl[b])[o];  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++cookie-\>offset;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( return\_hash )  
- h = new HashKey(entry-\>key, entry-\>len, entry-\>hash);  
+ h = new HashKey((const void \*)entry-\>key, entry-\>len, (unsigned int) entry-\>hash);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return entry-\>value;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

@@ -285,7 +285,7 @@

&nbsp;&nbsp;&nbsp;entry = (\*ttbl[b])[0];  
&nbsp;&nbsp;&nbsp;if ( return\_hash )  
- h = new HashKey(entry-\>key, entry-\>len, entry-\>hash);  
+ h = new HashKey((const void \*) entry-\>key, entry-\>len, (unsigned int) entry-\>hash);

&nbsp;&nbsp;&nbsp;cookie-\>bucket = b;  
&nbsp;&nbsp;&nbsp;cookie-\>offset = 1;

&nbsp;&nbsp;&nbsp;I have not tried to see if this is programaticaly correct, but with  
&nbsp;&nbsp;&nbsp;it bro compiles and runs fine for me (FreeBSD 5.1-CURRENT).

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- yann

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)
#### Post date: [May 6, 2022, 3:36pm UTC](https://community.zeek.org/t/errors-compiling-bro-pub-0-8a32-on-linux-2-4-20-8/387/4 "2022-05-06T15:36:47Z")

</div>


