Page 1 of 1

Compilation problems in Linux

Posted: Tue Mar 28, 2006 10:38 am
by Nevita
Hello.

I'm trying to compile Exult from CVS (downloaded 26 Mar 2006) on Ubuntu 5.10, amd64. I'm running into a few undefined symbol errors. I run ./autogen.sh, then ./configure, then make as I should. Everything goes well until we get into compiling the usecode compiler. The last few lines of my compilation are:

/bin/sh ../../libtool --tag=CXX --mode=link g++ -g -O2 -o ucc ucparse.o uclex.o ucmain.o ucexpr.o ucfun.o ucloc.o ucstmt.o ucsym.o ../libusecode.la -lasound
g++ -g -O2 -o ucc ucparse.o uclex.o ucmain.o ucexpr.o ucfun.o ucloc.o ucstmt.o ucsym.o ../.libs/libusecode.a /usr/lib/libasound.so -lm -ldl -lpthread
ucparse.o: In function `yyparse()':
/home/andrew/exult/usecode/compiler/ucparse.cc:1707: undefined reference to `yylex()'
ucparse.o: In function `yyparse()':
/home/andrew/exult/usecode/compiler/ucparse.yy:500: undefined reference to `start_script()'
/home/andrew/exult/usecode/compiler/ucparse.yy:512: undefined reference to `end_script()'
ucmain.o: In function `main':
/home/andrew/exult/usecode/compiler/ucmain.cc:107: undefined reference to `yyin'/home/andrew/exult/usecode/compiler/ucmain.cc:93: undefined reference to `yyin'
collect2: ld returned 1 exit status
make[3]: *** [ucc] Error 1
make[3]: Leaving directory `/home/andrew/exult/usecode/compiler'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/andrew/exult/usecode'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andrew/exult'
make: *** [all] Error 2

I'm wondering if anyone can suggest a fix, or tell me if I'm missing something. Thanks,

Andrew

Re: Compilation problems in Linux

Posted: Tue Mar 28, 2006 12:31 pm
by Wizardry Dragon
I wonder if this is related to the circular reference problem we encountered trying to compile on Mac.

--------
Peter M Dodge aka Wizardry Dragon
Lead Designer
Ultima VII: The Feudal Lands

Re: Compilation problems in Linux

Posted: Tue Mar 28, 2006 2:31 pm
by pak150
Here's a link to the mac problem:

http://exult.info/forum/viewtopic.php?p=28693#p28693

I was able to get it to compile by running make within the individual directories...

Re: Compilation problems in Linux

Posted: Tue Mar 28, 2006 3:29 pm
by Nevita
It appears to be a separate problem from what I can tell. Running make within individual directories has no effect.

From a very cursory glance at the source code, the problem might be in file ucparse.cc on line 274, where yylex() is declared as an extern. My guess is that whatever file that contains yylex() isn't being properly linked to ucparse.cc. Where is yylex() actually declared?

Re: Compilation problems in Linux

Posted: Tue Mar 28, 2006 4:40 pm
by drcode
I (supposedly) fixed the circular dependency problem a few days ago.

Re: Compilation problems in Linux

Posted: Tue Mar 28, 2006 6:35 pm
by Nevita
As I said, it doesn't appear to be the circular dependency problem. It appears to be a linking issue. I've noticed some differences between the ucparse.cc from CVS and the one from the stable 1.2 release, but I'm hesitant to change the header file includes in the version of ucparse.cc from CVS since I don't know what changes were made to the usecode compiler between versions.

Re: Compilation problems in Linux

Posted: Wed Mar 29, 2006 3:46 am
by artaxerxes
do you have flex and bison (or lex and yacc) installed?

Artaxerxes

Re: Compilation problems in Linux

Posted: Wed Mar 29, 2006 4:22 am
by Nevita
I have both flex and bison installed. If that were the problem, I would get a message about unknown command (which I did earlier as I was trying to figure out all the Ubuntu package dependancies to get Exult to compile).

Re: Compilation problems in Linux

Posted: Fri Mar 31, 2006 1:35 am
by nadir
/usr/lib/libfl.a is included in the flex package under Ubuntu, but automake should have added the -lfl to the link command

Re: Compilation problems in Linux

Posted: Fri Mar 31, 2006 7:11 am
by Nevita
I tried rerunning autogen.sh to see if that would fix the problem; it didn't. Is there another way to add the -lfl flag?