aMule Forum

English => Compilation problems => Topic started by: alantang888 on June 13, 2008, 01:07:11 PM

Title: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: alantang888 on June 13, 2008, 01:07:11 PM
HI,

when i use make after "./configure --prefix=/usr/local/aMule --enable-amule-daemon --enable-amulecmd --enable-webserver --enable-amule-gui --with-wxdir=/usr/local/wxWidgets/bin" got error, any can help???

Thank you

error:
Compiling Scanner.cpp
./Scanner.l: In function 'void LexFree()':
./Scanner.l:191: error: 'yylex_destroy' was not declared in this scope
make[3]: *** [libmuleappcore_a-Scanner.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: wuischke on June 13, 2008, 01:19:00 PM
Hi,

do you have flex installed?
Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: wcliao on June 13, 2008, 09:56:10 PM
I also had this problem when I compiled 2.2.1 on my FC4 machine.  I solved this by including  "Scanner.h.in" in Scanner.l  Hope this help.
Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: alantang888 on June 14, 2008, 07:33:48 AM
flex installed
rpm -qa |grep flex
flex-2.5.4a-41.fc6

Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: alantang888 on June 14, 2008, 07:36:24 AM
wcliao, your way is work!!!!  but got anther problem:

Linking amule
./libmuleappcore.a(libmuleappcore_a-Scanner.o): In function `LexFree()':
/root/aMule/aMule-2.2.1/src/./Scanner.l:191: undefined reference to `yylex_destroy()'
collect2: ld returned 1 exit status
make[3]: *** [amule] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


thank yoy  ;D
Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: PsychoChris on June 14, 2008, 05:40:09 PM
Hi wcliao,
thanks for the hint. Worked for me too.

EDIT:
Well, looks like i now have the same problem like alantang888. Compilation worked with adding the include but linking fails for the same reason.
Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: youpla on June 15, 2008, 06:27:45 PM
I had the same problem on a Mandriva system.
I thus checked the version of Flex that I had and it was 2.5.4a
I upgraded it to 2.5.35 and the error did not go away while compiling. I thus edited the Scanner.l file and applied the suggested patch.
It compiled just fine and the link worked like a charm.
Thus I would suggest upgrading the requirements in configure to force having a version post 2.5.4a and add the fix in Scanner.l

Regards

EDIT: this was trying to compile the aMule 2.2.1 tgz archive content, no source repository content at all.
Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: alantang888 on June 17, 2008, 12:40:46 PM
yeah!!! youpla's way is WORK!!!!! update flex to 2.5.35+ wcliao 's way "including  "Scanner.h.in" in Scanner.l" is success to make & install!!

flex 2.5.35 rpm:  ftp://ftp.uni-bayreuth.de/pub/redhat.com/fedora/linux/releases/9/Everything/i386/os/Packages/flex-2.5.35-1.fc9.i386.rpm
Title: Re: Compiling Scanner.cpp got problem in CentOS 5.1
Post by: steelskin on August 02, 2008, 05:31:29 PM
I had this same problem too, except on Suse 9.3.

Like the others above I added the following line to  ../src/Scanner.l

#include <Scanner.h.in>

and that fixed it for me too ..