Re: how to fix the following error message '/home/dooseop/torcs-1.3.7/export/lib/libtgfclient.so: undefined reference to `png_set_longjmp_fn''

David Savinkoff <[email protected]> Thu, 20 Apr 2017 12:08:12 -0600 (MDT)
Newsgroups gmane.games.torcs.general
Message-ID <2017047841.3344725.1492711692235.JavaMail.zimbra@mailid.telus.net>
----- Abhinav Verma wrote:
> Hi David,
> 
> Thanks for the response. I have similar issues and was trying to follow the steps in your notes. 

Are you using parameters or environment variables with make?
I've never compiled torcs this way. 
No: ( make TORCS_BASE=/home/user/torcs-1.3.7 MAKE_DEFAULT=/home/user/ )
Yes: ( make )

run ./configure with parameters from within the torcs/ directory
then run 'make' without parameters.

eg.
./configure --prefix=/home/dooseop/local
make
make install
make datainstall
...

> Regards,
> Abhinav
> 

`png_set_longjmp_fn' is Not supposed to be part of the build for Linux.
( It is part of the Windows(tm) build )

I discovered this by grep'ing TORCS sources:

$ find . -type f -print0 | xargs -0 grep -I png_set_longjmp_fn
./src/windows/include/png.h:PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structp png_ptr,
./src/windows/include/png.h:      (*png_set_longjmp_fn((png_ptr), longjmp, sizeof (jmp_buf)))
$



> > On Apr 19, 2017, at 7:42 PM, David Savinkoff wrote:
> > 
> > ----- cdsjjav wrote:
> >> Hello.
> >> 
> >> I'm trying to install TORCS on my desktop under Ubuntu 16.04.
> >> Following the steps for installation described in "
> >> http://torcs.sourceforge.net/"
> >> I have installed all the libraries such as libxmu-dev, libxmu6 etc.
> >> successfully.
> >> 
> >> However, I got the following error message when I tried to compile the
> >> source package (by typing 'make'),
> >> 
> >> make TORCS_BASE=/home/dooseop/torcs-1.3.7 MAKE_DEFAULT=/home/dooseop/
> > 
> > Do this instead:
> > ./configure --prefix=/home/dooseop/local
> > make
> > make install
> > make datainstall
> > 
> > 
> >> make[3]: Leaving directory '/home/dooseop/torcs-1.3.7/src/libs'
> >> make[3]: Entering directory '/home/dooseop/torcs-1.3.7/src/linux'
> >> g++ main.o linuxspec.o -L/home/dooseop/torcs-1.3.7/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/dooseop/torcs-1.3.7/export/lib/libtgfclient.so: undefined reference
> >> to `png_set_longjmp_fn'

`png_set_longjmp_fn' is Not supposed to be part of the build for Linux.
(It is part of the Windows(tm) build)


> >> collect2: error: ld returned 1 exit status
> >> /home/dooseop/torcs-1.3.7/Make-default.mk:405: recipe for target
> >> 'torcs-bin' failed
> >> make[3]: *** [torcs-bin] Error 1
> >> make[3]: Leaving directory '/home/dooseop/torcs-1.3.7/src/linux'
> >> /home/dooseop/torcs-1.3.7/Make-default.mk:679: recipe for target 'subdirs'
> >> failed
> >> make[2]: *** [subdirs] Error 1
> >> make[2]: Leaving directory '/home/dooseop/torcs-1.3.7/src'
> >> /home/dooseop/torcs-1.3.7/Make-default.mk:679: recipe for target 'subdirs'
> >> failed
> >> make[1]: *** [subdirs] Error 1
> >> make[1]: Leaving directory '/home/dooseop/torcs-1.3.7'
> >> Makefile:30: recipe for target 'restart' failed
> >> make: *** [restart] Error 2
> >> 
> >> In order to solve the problem, I have googled for long time .. but cannot
> >> find the solution.
> >> Is there anyone who can solve this problem.
> >> 
> >> Thank you for reading this e-main and would like to say sorry for my bad
> >> english..
> > 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot