# Errors while building pybroccoli?

**URL:** <https://community.zeek.org/t/errors-while-building-pybroccoli/1361>\
**Category:** Zeek\
**Created:** [July 16, 2008, 10:14pm UTC](https://community.zeek.org/t/errors-while-building-pybroccoli/1361 "2008-07-16T22:14:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Chan](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Stephen\_Chan](https://community.zeek.org/u/Stephen_Chan)\
**Post date:** [July 16, 2008, 10:14pm UTC](https://community.zeek.org/t/errors-while-building-pybroccoli/1361/1 "2008-07-16T22:14:13Z")

</div>

Hi,  
I just checked out the python bindings for broccoli and tried building it against Bro 1.3.2 using the suggested "python setup.py install". I am using python 2.4.3 and gcc 4.1.2 on CentOS 5

Unfortunately the build just results in a few screens of compilation errors and warnings. Looking at the Makefile, I decided to try regenerating the swing bindings and running setup.pu again. This cut down the number of errors to only a single screenful. Here's what I'm getting:  
[sychan@panopticon python]$ python setup.py install  
running install  
running build  
running build\_py  
creating build  
creating build/lib.linux-i686-2.4  
copying broccoli.py -\> build/lib.linux-i686-2.4  
running build\_ext  
building '\_broccoli\_intern' extension  
creating build/temp.linux-i686-2.4  
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D\_FORTIFY\_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D\_GNU\_SOURCE -fPIC -fPIC -I/usr/include/python2.4 -c broccoli\_intern\_wrap.c -o build/temp.linux-i686-2.4/broccoli\_intern\_wrap.o  
broccoli\_intern\_wrap.c:2504: warning: useless storage class specifier in empty declaration  
broccoli\_intern\_wrap.c: In function ‘valToPyObj’:  
broccoli\_intern\_wrap.c:2595: warning: pointer targets in passing argument 1 of ‘PyString\_FromStringAndSize’ differ in signedness  
broccoli\_intern\_wrap.c: In function ‘pyObjToVal’:  
broccoli\_intern\_wrap.c:2681: warning: pointer targets in assignment differ in signedness  
broccoli\_intern\_wrap.c: At top level:  
broccoli\_intern\_wrap.c:2762: error: expected declaration specifiers or ‘...’ before ‘BroEvMeta’  
broccoli\_intern\_wrap.c: In function ‘event\_callback’:  
broccoli\_intern\_wrap.c:2767: error: ‘meta’ undeclared (first use in this function)  
broccoli\_intern\_wrap.c:2767: error: (Each undeclared identifier is reported only once  
broccoli\_intern\_wrap.c:2767: error: for each function it appears in.)  
broccoli\_intern\_wrap.c: In function ‘\_wrap\_bro\_event\_add\_val’:  
broccoli\_intern\_wrap.c:4716: warning: assignment discards qualifiers from pointer target type  
broccoli\_intern\_wrap.c: In function ‘\_wrap\_bro\_event\_set\_val’:  
broccoli\_intern\_wrap.c:4786: warning: assignment discards qualifiers from pointer target type  
broccoli\_intern\_wrap.c: In function ‘\_wrap\_bro\_event\_registry\_add\_compact’:  
broccoli\_intern\_wrap.c:4988: warning: assignment from incompatible pointer type  
broccoli\_intern\_wrap.c: In function ‘\_wrap\_bro\_record\_add\_val’:  
broccoli\_intern\_wrap.c:5849: warning: assignment discards qualifiers from pointer target type  
broccoli\_intern\_wrap.c: In function ‘\_wrap\_bro\_record\_set\_nth\_val’:  
broccoli\_intern\_wrap.c:6004: warning: assignment discards qualifiers from pointer target type  
broccoli\_intern\_wrap.c: In function ‘\_wrap\_bro\_record\_set\_named\_val’:  
broccoli\_intern\_wrap.c:6075: warning: assignment discards qualifiers from pointer target type  
error: command 'gcc' failed with exit status 1  
[sychan@panopticon python]$

The first error "broccoli\_intern\_wrap.c:2762: error: expected declaration specifiers or ‘...’ before ‘BroEvMeta’" references this:  
// C-level event handler for events. We register all events with this callback,  
// passing the target Python function in via data.  
void event\_callback(BroConn \*bc, void \*data, BroEvMeta \*meta)  
{  
...

I don't see any declaration for the BroEvMeta type anywhere. There's a reference to this type in [http://svn.icir.org/bro/trunk/bro/aux/broccoli/test/broping.c](http://svn.icir.org/bro/trunk/bro/aux/broccoli/test/broping.c) in the bro\_pong\_compact() declaration:

static void bro\_pong\_compact(BroConn \*conn, void \*data, BroEvMeta \*meta)

However signature in my version of the broping is:  
static void bro\_pong\_compact(BroConn \*conn, void \*data, int num\_args, BroEvArg \*args)

I'm guessing that things have changed since the 1.3.2 release and that the python bindings are against the current code base. Is that true?  
Do I need to download the latest bro source tree via subversion to use the pythong bindings?

Steve

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [July 17, 2008, 12:29am UTC](https://community.zeek.org/t/errors-while-building-pybroccoli/1361/2 "2008-07-17T00:29:20Z")

</div>

Yes, that's the problem here. There was an API change in Broccoli  
that in turn required the Python bindings to be adapted, which is  
why you're seeing these mismatches.

If you don't want to upgrade Broccoli, you could check out an older  
revision of the Python bindings from my branch. The relevant change  
was in revision 5937 so if you, say, checkout revision 5936 it  
should work (and there haven't been any other changes since this to  
the bindings).

Robin

---

<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:38pm UTC](https://community.zeek.org/t/errors-while-building-pybroccoli/1361/3 "2022-05-06T15:38:36Z")

</div>


