I was trying to install torcs. However while making the file I am experiencing the following problem

make[4]: Entering directory '/home/kenny/Local/torcs/src/libs/math'
make[4]: Nothing to be done for 'compil'.
make[4]: Leaving directory '/home/kenny/Local/torcs/src/libs/math'
make[4]: Entering directory 
g++ -I/home/kenny/Local/torcs/export/include -I/home/kenny/Local/torcs 
-g -O2 -Wall -fPIC -fno-strict-aliasing -O2 -DUSE_RANDR_EXT - 
DGL_GLEXT_PROTOTYPES -Wall -fPIC -fno-strict-aliasing -O2 - 
DSHM -DHAVE_CONFIG_H  -c OpenALMusicPlayer.cpp
In file included from /usr/include/bits/libc-header-start.h:33,
             from /usr/include/stdio.h:27,
             from OpenALMusicPlayer.cpp:20:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and 
_SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use 
OpenALMusicPlayer.cpp: In member function ‘virtual bool 
OpenALMusicPlayer.cpp:164:22: error: invalid conversion from ‘char’ to 
‘const char*’ [-fpermissive]
 const char* error = '\0';
 make[4]: *** [/home/kenny/Local/torcs/Make-default.mk:240: 
 OpenALMusicPlayer.o] Error 1
 make[4]: Leaving directory 
 make[3]: *** [/home/kenny/Local/torcs/Make-default.mk:679: subdirs] 
 Error 1
 make[3]: Leaving directory '/home/kenny/Local/torcs/src/libs'
 make[2]: *** [/home/kenny/Local/torcs/Make-default.mk:679: subdirs] 
 Error 1
 make[2]: Leaving directory '/home/kenny/Local/torcs/src'
 make[1]: *** [/home/kenny/Local/torcs/Make-default.mk:679: subdirs] 
 Error 1
 make[1]: Leaving directory '/home/kenny/Local/torcs'
 make: *** [Makefile:32: restart] Error 2

Can someone suggest how to resolve the issue


From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853685, version 1.3.7+dfsg-4 of torcs in the Debian repos contains the patch that fixes the build error you are experiencing by changing the pointer in the problematic line to point to a nullptr instead.

-   const char* error = '\0';
+   const char* error = nullptr;

The full patch file is at https://sources.debian.org/patches/torcs/1.3.7+dfsg-4/gcc7.patch/ and the fix it introduces is platform-neutral. Alternatively, you can compile with -fpermissive as your log hints.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.