Centos 7 成功安装 dosbox 解决 "error: expected primary-expression before ‘,’ token" 错误
阅读原文时间:2023年07月09日阅读:3

dosbox-0.74 bug 修复版下载: http://download.csdn.net/detail/yangbodong22011/9663271

注意:这篇博客解决了下面这个问题,如果你也恰巧遇到了这个问题,请继续往下读,完整的安装过程后面也有。

make 操作错误信息如下:

In file included from ../../include/programs.h:28:0,
                 from cpu.cpp:29:
../../include/dos_inc.h: In member function ‘void DOS_MCB::SetFileName(const char*)’:
../../include/dos_inc.h:543:78: error: expected primary-expression before ‘,’ token
  void SetFileName(char const * const _name) { MEM_BlockWrite(pt+offsetof(sMCB,filename),_name,8); }

......(省略)

cpu.cpp: In member function ‘void TaskStateSegment::Get_SSx_ESPx(Bitu, Bitu&, Bitu&)’:
cpu.cpp:294:37: error: expected primary-expression before ‘,’ token
    PhysPt where=base+offsetof(TSS_32,esp0)+level*8;
                                     ^
cpu.cpp:294:38: error: ‘esp0’ was not declared in this scope
    PhysPt where=base+offsetof(TSS_32,esp0)+level*8;
                                      ^
cpu.cpp:294:42: error: ‘offsetof’ was not declared in this scope
    PhysPt where=base+offsetof(TSS_32,esp0)+level*8;
                                          ^
......(省略)

安装过程如下:

下载地址: https://sourceforge.net/projects/dosbox/

$ tar xvf dosbox-0.74.tar.gz
$ cd dosbox-0.74/

$ ./configure

发现错误如下所示:

提醒没有SDL,yum 直接安装就好

$ yum install SDL
$ yum install SDL-devel

安装好之后./configure就可以成功了

$ make

报错如下:

https://www.vogons.org/viewtopic.php?f=31&t=45585

好了,之后我找到了解决方法,不卖关子了,用下面链接中的dos_inc.h替换原目录中include/dos_inc.h就好了,链接在此:

http://sources.debian.net/src/dosbox/0.74-4.2/include/dos_inc.h/

替换之后,make成功,或者你 直接下载我在文章开头给出的修复版本

$ make install

$ dosbox

之后的使用操作我就不赘述了,遇到问题,解决问题总是让人开心的,如果也解决了你的问题,请点个赞吧!

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章