1. 程式人生 > >mac安裝bochs報錯cdrom_osx.cc:194:18: error: assigning to 'char ' from incompatible type 'const ch

mac安裝bochs報錯cdrom_osx.cc:194:18: error: assigning to 'char ' from incompatible type 'const ch

按照網上的配,一切都正常
[這裡是配置的步驟](https://blog.nswebfrog.com/2017/02/03/config-bochs/)

但是就當我make的時候,去突然報錯了,報錯如下:

cdrom_osx.cc:194:18: error: assigning to 'char ' from incompatible type 'const ch

於是在網上查了一下,這個報錯有個補丁[https://raw.githubusercontent.com/Homebrew/formula-patches/e9b520dd4c/bochs/xcode9.patch]

也就是把cdrom_osx.cc中出錯的這一行
if ((devname = strrchr(devpath, '/')) != NULL) {


改為:
if ((devname = (char *) strrchr(devpath, '/')) != NULL) {
即可make和make install成功
注意有兩點:1。make install 要在前面加上sudo
2。要安裝bochs2.6.8版本,2.6.9版本這個錯誤解決完還有一大堆錯誤,為了縮短配置時間,建議用2.6.8版本的bochs吧。
成功開啟bochs頁面
在這裡插入圖片描述