Building on Windows with MinGW

Por wbahnassi

Master (146)

Imagen del wbahnassi

07-06-2020, 02:11

Hi, I'm trying to build openMSX on Windows through MinGW. However, it's failing miserably right from the get-go. I installed MinGW into C:\MinGW. During installation I ticked the C++ compiler and MSYS base tools. All good. Launched a shell from C:\MinGW\msys\1.0\msys.bat and navigated to openMSX folder and entered ./configure just to be greeted with:

$ ./configure
Using Python: python3
Error determining MSYS root: b'  File "", line 1\r\n    import sys ; print sys.argv[1]\r\n                       ^\r\nSyntaxError: invalid syntax\r\n'
Exit code 1
Traceback (most recent call last):
  File "build/", line 5, in 
    from executils import captureStdout
  File "c:\Users\wbahnassi\Desktop\openMSX\build\", line 1, in 
    from msysutils import msysActive, msysShell
  File "c:\Users\wbahnassi\Desktop\openMSX\build\", line 70, in 
    msysMounts = _determineMounts()
  File "c:\Users\wbahnassi\Desktop\openMSX\build\", line 25, in _determineMounts
    raise OSError('Error determining MSYS root')
OSError: Error determining MSYS root
build/ *** No platform specified using OPENMSX_TARGET_CPU and OPENMSX_TARGET_OS and autodetection of local platform failed.  Stop.

I double-checked that my openMSX files are all ending with LF instead of CRLF (adjusted git's config to do so), and Notepad++ confirms that too, so I'm lost as to where the CRLF is creeping in from. After all, those are code-generated lines from

# Figure out the root directory of MSYS.
	proc = Popen(
		[ msysShell(), '-c', '"%s" -c \'import sys ; print sys.argv[1]\' /' % sys.executable.replace('\\', '\\\\') ],
		stdin = None,
		stdout = PIPE,
		stderr = PIPE,

There doesn't seem to be any new-line characters involved.. Help?


Login sesión o register para postear comentarios

Por sdsnatcher73

Prophet (2234)

Imagen del sdsnatcher73

07-06-2020, 07:54

I’ve tried several ways (with mingw, mingw64, mingw on top of Cygwin) but ultimately was never able to build openMSX that way. What did work for me is using Windows Subsystem for Linux (aka WSL). I installed Ubuntu from the Windows Store, installed mingw through apt and cross compile openMSX for Windows on Linux on Windows (fun right).

You can look in the GitHub actions for Windows In the repo to find the steps to build correctly.

Por wbahnassi

Master (146)

Imagen del wbahnassi

07-06-2020, 12:59

Oof.. and here I was hoping to be able to make Windows compile openMSX for Android.

Por Manuel

Ascended (18148)

Imagen del Manuel

07-06-2020, 13:06

In the past we built the Windows version always with MinGW/MSYS (on Windows itself), so it has worked.... and the cross compile also works. So I expect it shouldn't be too hard to get it working again. mth is the expert here, though.