Re: Bug-report regarding torcs-1.3.4 installation and robotgen -- including fixes

Bernhard Wymann <[email protected]>
Newsgroups gmane.games.torcs.general
Organization wytec
Message-ID <[email protected]>
http://www.gentoo.org/proj/en/qa/asneeded.xml

"
Failure in final linking, undefined symbols

This is the most common error that happens while using --as-needed. It 
happens during the final linking stage of an executable (libraries don't 
create problems, because they are allowed to have undefined symbols). 
The executable linking stage dies because of an undefined symbol that is 
present in one of the libraries fed to the command line. However, the 
library is not used by the executable itself, thus it gets removed by 
--as-needed.

This usually means that a library was not linked to another library, but 
was using it, and then relying on the final executable to link them 
together. This behavior is also an extra encumbrance on developers using 
that library because they have to check for the requirements.
"

Ok, exactly this is the problem, so your patch is the way to go. Thank 
you very much:-) Complete patch is commited.

Best regards

Bernhard


On 01/09/2013 09:35 AM, Jasper van de Ven wrote:
> Hello,
> while preparing a system in order to develop a robot for torcs, I came
> across two minor problems.
> I am using a Ubuntu 12.10 64Bit system and the "For Linux and FreeBSD
> from "all-in-one" Source Package".
>
> The first is a small bug in the make-setup of torcs-1.3.4. When
> executing the 'make' command I got a linker error stating:
>
> g++ main.o linuxspec.o -L/home/<...>/torcs-1.3.4/export/lib  -lopenal
> -lalut -lvorbisfile -L/usr/lib  -lracescreens -lrobottools -lclient
> -lconfscreens -ltgf -ltgfclient -ltxml -lplibul -lraceengine
> -lmusicplayer -llearning -lplibjs -lplibssgaux -lplibssg -lplibsm
> -lplibsl -lplibsg -lplibul -lglut -lGLU -lGL -lpng -lz -ldl -lXrandr
> -lXrender -lXxf86vm -lXmu -lXi -lXt -lSM -lICE -lXext -lX11 -lm  -o
> torcs-bin
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmShowStandings(void*, RmInfo*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmDriversSelect(void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmPitMenuStart(CarElt*, void*, void (*)(void*))'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RtTrackGetSeg(tTrkLocPos*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmLoadingScreenSetText(char const*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RtTrackHeightL(tTrkLocPos*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmFourStateScreen(char const*, char const*, char const*, void*, char
> const*, char const*, void*, char const*, char const*, void*, char
> const*, char const*, void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmRaceParamMenu(void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmShowResults(void*, RmInfo*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmTriStateScreen(char const*, char const*, char const*, void*, char
> const*, char const*, void*, char const*, char const*, void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RtTrackLocal2Global(tTrkLocPos*, float*, float*, int)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmFileSelect(void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmTrackSelect(void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmLoadingScreenStart(char const*, char const*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmDisplayStartRace(RmInfo*, void*, void*)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RtTrackGetWidth(trackSeg*, float)'
> /home/<...>/torcs-1.3.4/export/lib/libraceengine.so: undefined reference
> to `RmShutdownLoadingScreen()'
> collect2: error: ld returned 1 exit status
> make[3]: *** [torcs-bin] Error 1
>
> I was able to trace the error to a pair of missing linker option
> (-lracescreens -lrobottools) while linking libraceengine.so. I fixed it
> by adding the required options to the local Makfile and adding the
> general call to the Make-default.mk template.
>
> The second bug I encountered addresses the robotgen script. Simply using
> the provided script, directly compiling and installing the freshly and
> unchanged driver, starting torcs and clicking "Race -> Quick Race ->
> Configure Race" leads to a segmentation fault. For that matter all race
> types have this problem as it is related to loading the freshly
> generated robot. I was able to find the error in the <Robotname>.cpp
> file where the name and description are set. I fixed the problem by
> adding a string-duplication command to the robotgen script.
>
> All proposed fixes can be found in the attached patch. It can be easily
> applied (supposed one is using a Linux system) by executing the command
> 'patch -p1 -i torcs-1.3.4-fixes.patch' in the base folder. The patch was
> generated against a unchanged version of the "For Linux and FreeBSD from
> "all-in-one" Source Package". Hope this helps anyone experiencing
> similar difficulties.
> Greetings
> Jasper
>
>
>
> ------------------------------------------------------------------------------
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612
>
>
>
> _______________________________________________
> Torcs-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/torcs-users
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.