aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Compiling Scanner.cpp got problem in CentOS 5.1  (Read 10470 times)

alantang888

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Compiling Scanner.cpp got problem in CentOS 5.1
« 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

Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #1 on: June 13, 2008, 01:19:00 PM »

Hi,

do you have flex installed?
Logged

wcliao

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #2 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.
Logged

alantang888

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #3 on: June 14, 2008, 07:33:48 AM »

flex installed
rpm -qa |grep flex
flex-2.5.4a-41.fc6

Logged

alantang888

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #4 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
« Last Edit: June 14, 2008, 07:45:37 AM by alantang888 »
Logged

PsychoChris

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 66
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #5 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.
« Last Edit: June 14, 2008, 07:04:23 PM by PsychoChris »
Logged

youpla

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 26
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #6 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.
« Last Edit: June 15, 2008, 06:31:09 PM by youpla »
Logged

alantang888

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #7 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
Logged

steelskin

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 1
Re: Compiling Scanner.cpp got problem in CentOS 5.1
« Reply #8 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 ..
Logged