Centos 7 成功安装 dosbox 解决 "error: expected primary-expression before ‘,’ token" 错误

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;
                                          ^
......(省略)

安装过程如下:

一:下载dosbox

下载地址: 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)

$ make

报错如下:

这也是最难解决的地方,好多人安装至此就放弃了,源码的符号错误谁能接受!瞬间对dosbox作者水平产生怀疑。但是呢,人非圣贤,孰能无过。找啊找,竟然真的找到了dosbox作者对这个问题的回答。

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

$ make install

六:启动

$ dosbox

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

相关文章

#使用军哥的lnmp配置虚拟主机,需要注意的是要配置hosts文件(...
一、配置编译环境 yum update && yum upgra...
一、下载repo文件 二、备份并替换系统的repo文件 三、执行yu...
LAMP -- Linux Apache MySQL PHP 在CentOS安装的顺序,我一般...
一、下载nginx安装包,官网下载中心http://nginx.org/downlo...
1.下载composer curl -sS https://getcomposer.org/installe...