[Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)
Posted: Tue 10 Oct, 2017 7:32 am
The September 2020 Edition
[2018-02-13: Update instructions on compiling PCem after update...
[2018-02-14: Added autoreconf into the mix. Should hopefully make to process more robust.
Thanks to darksabre76, compiling PCem in MSYS2 has gotten even easier than it was before. I now present to you the September 2020 edition of this guide.
Download and install MSYS2
Download MSYS2 from http://www.msys2.org/. I686 or x86_64 doesn't matter. Install it.
For the rest of this guide, I will refer to the installation directory of MSYS2 (eg: C:\msys64) as <msys>
When the install finishes, it should open the MSYS2 MSYS shell. We next need to update our MSYS2 installation by typing the following in the shell:
If it asks if you want to remove catgets, do so. There appears to be a conflict at time of writing.
You will be asked to close the terminal without exiting. Just click the x at the window corner, and wait till it crashes
From the start menu, search for MSYS, and select MSYS2 MSYS. Run the previous pacman command again:
MSYS2 has now been updated to the latest packages.
Install prerequisites
From the MSYS2 MSYS shell, type the following to install the mingw-w64 32 bit toolchain, base-devel (for autotools such as autoreconf), mercurial (used to download PCem later), and unzip:
When it asks what to install, press <enter> to select all for installation.
Next, we install the PCem dependencies OpenAL, SDL2 and wxWidgets:
Download and install the npcap SDK (for networking):
Close the MSYS2 MSYS shell.
For pcap networking to work, download the Npcap installer from https://nmap.org/npcap/
Install Npcap. Ensure to check the "Install Npcap in WinPcap API-compatible Mode" checkbox during the installation process.
Prepare and Compile PCem
Open the MSYS2 MinGW 32-bit shell from the start menu. Note, do NOT use the "MSYS2 MSYS" shell for the rest of this guide, it won't work!
Download PCem from bitbucket using mercurial:
This is where darksabre76 made our lives much easier. As of commit 45a203d, we no longer have to use (and maintain) a special Makefile. The following should configure and compile PCem for us:
Hopefully, PCem should compile without errors.
Post Compilation Steps
Create a pcem runtime directory structure with configs, nvr, roms and screenshot folders. Populate roms folder etc.
If they exist, delete all current exe and dll files
Alternatively, the parent pcem directory contains the required directory structure.
Copy the newly compiled pcem.exe file into this directory
Also copy the following libraries from the <msys>\mingw32\bin directory:
Run PCem. If for some reason it complains of missing dlls, they should be in the directory you copied the previous dlls from.
Recompiling after updated revisions
From the MSYS2 MinGW 32-bit shell:
Hopefully this guide will have got you up and running with a freshly compiled PCem, ready for testing.
[2018-02-13: Update instructions on compiling PCem after update...
[2018-02-14: Added autoreconf into the mix. Should hopefully make to process more robust.
Thanks to darksabre76, compiling PCem in MSYS2 has gotten even easier than it was before. I now present to you the September 2020 edition of this guide.
Download and install MSYS2
Download MSYS2 from http://www.msys2.org/. I686 or x86_64 doesn't matter. Install it.
For the rest of this guide, I will refer to the installation directory of MSYS2 (eg: C:\msys64) as <msys>
When the install finishes, it should open the MSYS2 MSYS shell. We next need to update our MSYS2 installation by typing the following in the shell:
Code: Select all
$ pacman -Syuu
You will be asked to close the terminal without exiting. Just click the x at the window corner, and wait till it crashes
From the start menu, search for MSYS, and select MSYS2 MSYS. Run the previous pacman command again:
Code: Select all
$ pacman -Syuu
Install prerequisites
From the MSYS2 MSYS shell, type the following to install the mingw-w64 32 bit toolchain, base-devel (for autotools such as autoreconf), mercurial (used to download PCem later), and unzip:
Code: Select all
$ pacman -S mingw-w64-i686-toolchain base-devel git unzip
Next, we install the PCem dependencies OpenAL, SDL2 and wxWidgets:
Code: Select all
$ pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-openal mingw-w64-i686-wxWidgets
Code: Select all
$ wget https://nmap.org/npcap/dist/npcap-sdk-1.05.zip
$ unzip -d npcap-sdk-1.05/ npcap-sdk-1.05.zip
$ cd npcap-sdk-1.05
$ cp -r Include/* /mingw32/include/
$ cp -r Lib/* /mingw32/lib/
For pcap networking to work, download the Npcap installer from https://nmap.org/npcap/
Install Npcap. Ensure to check the "Install Npcap in WinPcap API-compatible Mode" checkbox during the installation process.
Prepare and Compile PCem
Open the MSYS2 MinGW 32-bit shell from the start menu. Note, do NOT use the "MSYS2 MSYS" shell for the rest of this guide, it won't work!
Download PCem from bitbucket using mercurial:
Code: Select all
$ git clone https://github.com/sarah-walker-pcem/pcem
$ cd pcem
Code: Select all
$ autoreconf -i
$ ./configure --enable-networking --enable-release-build
$ mingw32-make -j
Post Compilation Steps
Create a pcem runtime directory structure with configs, nvr, roms and screenshot folders. Populate roms folder etc.
If they exist, delete all current exe and dll files
Alternatively, the parent pcem directory contains the required directory structure.
Copy the newly compiled pcem.exe file into this directory
Also copy the following libraries from the <msys>\mingw32\bin directory:
Code: Select all
libgcc_s_dw2-1.dll
libjpeg-8.dll
libopenal-1.dll
libpng16-16.dll
libstdc++-6.dll
libtiff-5.dll
libwinpthread-1.dll
SDL2.dll
zlib1.dll
all wx*.dll files
dreamer suggests that liblzma-5.dll may also be required.
Recompiling after updated revisions
From the MSYS2 MinGW 32-bit shell:
Code: Select all
$ cd ~/pcem
$ mingw32-make clean
$ hg pull && hg update default
$ autoreconf -i
$ ./configure --enable-networking --enable-release-build
$ mingw32-make -j