Compilation problems in Linux

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Nevita

Compilation problems in Linux

Post 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
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: Compilation problems in Linux

Post 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
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
pak150
Posts: 35
Joined: Thu May 14, 2020 1:34 pm

Re: Compilation problems in Linux

Post 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...
Nevita

Re: Compilation problems in Linux

Post 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?
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Compilation problems in Linux

Post by drcode »

I (supposedly) fixed the circular dependency problem a few days ago.
Nevita

Re: Compilation problems in Linux

Post 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.
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: Compilation problems in Linux

Post by artaxerxes »

do you have flex and bison (or lex and yacc) installed?

Artaxerxes
Nevita

Re: Compilation problems in Linux

Post 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).
nadir
Site Admin
Posts: 407
Joined: Thu May 14, 2020 1:34 pm

Re: Compilation problems in Linux

Post 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
Nevita

Re: Compilation problems in Linux

Post 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?
Locked