Page 1 of 1

update-need help: error compiling plugin

Posted: Fri Sep 04, 2009 12:54 pm
by nostromo
I have a little problem compiling a plugin (never did it before, maybe i forgot a thing)

-Sourcecode downloaded (2.0.13), extracted
-I can compile successfully bzflag, bzadmin, bzfs and all the included plugins)

-Downloaded the source for /timelimit plugin from catay (http://catay.be/bzplugins/TimeLimit/Tim ... .4.tar.bz2)

-did a ./newplug TimeLimit in the plugin folder
-pasted the cpp into the folder
-in /plugins makefile.am I added /Timelimit/Makefile
-in configure.ac I added /plugins/TimeLimit/Makefile

-added the file into the /plugin/Timelimit

-did an .autogen.sh

- configure, make, make install

As a result, I got errors, but no plugin (I made sure that uper and lower cases are correct..)

Code: Select all


make[3]: Leaving directory `/home/source/plugins/SAMPLE_PLUGIN'
Making install in TimeLimit
make[3]: Entering directory `/home/source/plugins/TimeLimit'
/bin/sh ../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../include    -I../../include -I../../plugins/plugin_utils -g -O2  -Wall -W -ffast-math -fno-exceptions -c -o TimeLimit_la-TimeLimit.lo `test -f 'TimeLimit.cpp' || echo './'`TimeLimit.cpp
 g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../plugins/plugin_utils -g -O2 -Wall -W -ffast-math -fno-exceptions -c TimeLimit.cpp  -fPIC -DPIC -o .libs/TimeLimit_la-TimeLimit.o
TimeLimit.cpp: In function 'bool isValidTime(float)':
TimeLimit.cpp:72: error: 'atof' was not declared in this scope
TimeLimit.cpp: In function 'void parseCommand(const char*)':
TimeLimit.cpp:132: error: 'atoi' was not declared in this scope
TimeLimit.cpp: In member function 'virtual bool TimeLimit::handle(int, bzApiString, bzApiString, bzAPIStringList*)':
TimeLimit.cpp:151: error: 'strcasecmp' was not declared in this scope
TimeLimit.cpp:174: error: 'strcasecmp' was not declared in this scope
TimeLimit.cpp:193: error: 'strcasecmp' was not declared in this scope
TimeLimit.cpp:201: error: 'strlen' was not declared in this scope
TimeLimit.cpp:206: error: 'atof' was not declared in this scope
make[3]: *** [TimeLimit_la-TimeLimit.lo] Error 1
make[3]: Leaving directory `/home/source/plugins/TimeLimit'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/source/plugins'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/source'
make: *** [install-strip] Error 2

:book:

Re: need help: error compiling plugin

Posted: Fri Sep 04, 2009 2:29 pm
by Anxuiz
Try adding #include "stdlib.h" to the beginning of the cpp file and see if that works. Sounds like there's a file that didn't get included there.

Re: need help: error compiling plugin

Posted: Fri Sep 04, 2009 4:57 pm
by nostromo
I tried it woth adding +include "stdlib.h"
No success, more or less the same error

Code: Select all


Making install in TimeLimit
make[3]: Entering directory `/home/source/plugins/TimeLimit'
/bin/sh ../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../include    -I../../include -I../../plugins/plugin_utils -g -O2  -Wall -W -ffast-math -fno-exceptions -c -o TimeLimit_la-TimeLimit.lo `test -f 'TimeLimit.cpp' || echo './'`TimeLimit.cpp
 g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../plugins/plugin_utils -g -O2 -Wall -W -ffast-math -fno-exceptions -c TimeLimit.cpp  -fPIC -DPIC -o .libs/TimeLimit_la-TimeLimit.o
TimeLimit.cpp: In member function 'virtual bool TimeLimit::handle(int, bzApiString, bzApiString, bzAPIStringList*)':
TimeLimit.cpp:152: error: 'strcasecmp' was not declared in this scope
TimeLimit.cpp:175: error: 'strcasecmp' was not declared in this scope
TimeLimit.cpp:194: error: 'strcasecmp' was not declared in this scope
TimeLimit.cpp:202: error: 'strlen' was not declared in this scope
make[3]: *** [TimeLimit_la-TimeLimit.lo] Error 1
make[3]: Leaving directory `/home/source/plugins/TimeLimit'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/source/plugins'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/source'
make: *** [install-strip] Error 2

Maybe on of you can try to compile it and send it to me? I would like to do it by myself, but ....

Re: need help: error compiling plugin

Posted: Fri Sep 04, 2009 10:22 pm
by Anxuiz
Oh, okay. Add

Code: Select all

#include <string.h>
that should make it work.

Re: need help: error compiling plugin

Posted: Fri Sep 04, 2009 11:27 pm
by nostromo
Tried it again with

#include "stdlib.h"
#include <string.h>

compiled it without problems, ! :D

Big, big thank you for your help, Yassen.

Re: need help: error compiling plugin

Posted: Wed Sep 09, 2009 8:34 pm
by nostromo
A new day, a new problem. :doh:

I am able now to compile the source to get bzflag, bzfs, and plugins. I mastered the problems with compiling the TimeLimit Plugin.

Now I have the following problem:
I tried to set it up, but I get the following failure:

/timelimit.so found but does not contain bz_Load method, error
./bzfs: undefined symbol: bz_Load


I used the the 1.0.4 plugin version with some 2.0.13ish source (downloaded from the debian repository), so I shouldnt need the patch. If I need the patch (catay posted for 2.0.8), how do I apply it to 2.0.13 source code?
:turtle:

Re: update-need help: error compiling plugin

Posted: Sat Sep 12, 2009 7:24 pm
by nostromo
Just to update this topic:

the failure was somewhere in the config with wrong upper / lower case.