torcs 安装问题,openal 错误

torcs 安装问题,openal 错误

我试图安装托克。但是在制作文件时我遇到了以下问题

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 
'/home/kenny/Local/torcs/src/libs/musicplayer'
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 - 
DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES  -D_SVID_SOURCE -D_BSD_SOURCE - 
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 
_DEFAULT_SOURCE"
    ^~~~~~~
OpenALMusicPlayer.cpp: In member function ‘virtual bool 
OpenALMusicPlayer::streamBuffer(ALuint)’:
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 
 '/home/kenny/Local/torcs/src/libs/musicplayer'
 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

有人可以建议如何解决这个问题

答案1

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853685,Debian 存储库中的 torcs 版本 1.3.7+dfsg-4 包含修复您遇到的构建错误的补丁,方法是将有问题的行中的指针更改为指向 a nullptr

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

完整的补丁文件位于https://sources.debian.org/patches/torcs/1.3.7+dfsg-4/gcc7.patch/它引入的修复是平台中立的。或者,您可以-fpermissive按照日志提示进行编译。

相关内容