[Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Discussion of development and patch submission.
User avatar
dns2kv2
Posts: 67
Joined: Sun 19 Feb, 2017 3:30 am

Re: [Feb 2018 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by dns2kv2 »

Just share an update from my previous test, might save the day for others.

got this hick cup while updating pcem:

Code: Select all

mingw32-make clean
CDPATH="${ZSH_VERSION+.}:" && cd . && C:/msys32/usr/bin/sh.exe /home/{your username}/pcem/missing aclocal-1.15
aclocal-1.15: error: aclocal: file '/msys32/usr/share/aclocal/xsize.m4' does not exist
mingw32-make: *** [Makefile:354: aclocal.m4] Error 1

The cure is easy, add another "autoreconf -i" command before "mingw32-make clean" command:

Code: Select all

#clean previous build, redownload & update pcem sources then recompile pcem
#open MSYS2 MinGW 32-bit shell (C:\msys32\mingw32.exe) and run below command:
cd ~/pcem
autoreconf -i
mingw32-make clean
hg pull && hg update default
autoreconf -i
./configure --enable-networking --enable-release-build
mingw32-make -j
Zilog
Posts: 51
Joined: Wed 13 May, 2015 8:01 pm

Re: [Feb 2018 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by Zilog »

Hi To,
i have this problem when compile pcem on Windows:

collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [Makefile:908: pcem.exe] Error 1
mingw32-make[1]: Leaving directory 'D:/_msys64/home/user/pcem/src'
mingw32-make: *** [Makefile:364: all-recursive] Error 1

Very Thanks a lot for all help.
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by shermanp »

Just made a few updates to the OP. No major changes, but I went through it again on the latest version of MSYS2 (still slow, sigh...).

Main changes are using an updated version of the npcap SDK, and using git to clone the github pcem repository.
A. Naim
Posts: 139
Joined: Thu 09 Jul, 2015 5:06 pm

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by A. Naim »

"error: perl: signature from "David Macek <david.macek.0@gmail.com>" is invalid
:: File /var/cache/pacman/pkg/perl-5.32.0-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature))."
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by shermanp »

Note, if you haven't updated MSYS2 in a while, there's been some package maintainer changes and corresponding signing key changes. I found it easier to restart from scratch with a fresh MSYS2 reinstall.
JosepMa
Posts: 193
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by JosepMa »

I saw that there are some instructions in the news sections. But indeed, it can need multiple steps depending on when it was last updated
https://www.msys2.org/news/

I had to do this:
Follow instructions in the 2020-06-29 news.
Then follow instructions in the 2020-05-22 news.
In your case (problems with .zst), you might probably need to do 2020-05-31 news.
Then a package -Syu,
Then Follow 2020-06-15 news.

That got my msys2 up to date.
A. Naim
Posts: 139
Joined: Thu 09 Jul, 2015 5:06 pm

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by A. Naim »

shermanp wrote: Sun 27 Sep, 2020 9:39 pm Note, if you haven't updated MSYS2 in a while, there's been some package maintainer changes and corresponding signing key changes. I found it easier to restart from scratch with a fresh MSYS2 reinstall.
Thanks; it compiles now. :)
JosepMa wrote: Mon 28 Sep, 2020 8:19 pm I saw that there are some instructions in the news sections. But indeed, it can need multiple steps depending on when it was last updated
https://www.msys2.org/news/

I had to do this:
Follow instructions in the 2020-06-29 news.
Then follow instructions in the 2020-05-22 news.
In your case (problems with .zst), you might probably need to do 2020-05-31 news.
Then a package -Syu,
Then Follow 2020-06-15 news.

That got my msys2 up to date.
Thanks, but it's a little too late now. :)
JonyP27
Posts: 5
Joined: Sat 07 Mar, 2020 2:01 am

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by JonyP27 »

After I compiled the lastest v17 using this guide I cannot run the resulting .exe file and it gives the following errors:

"The procedure entry point _divmoddi4 could not be located in the DLL (dynamic-link library) C:\msys64\home\[user]\pcem\pcem.exe"
"The procedure entry point _divmoddi4 could not be located in the DLL (dynamic-link library) C:\msys64\home\[user]\pcem\libopenal-1.dll"

These errors appear even after copying all the necessary .dll files from the msys64 bin folder itself. Maybe it has to do with the OpenAL lib?
JonyP27
Posts: 5
Joined: Sat 07 Mar, 2020 2:01 am

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by JonyP27 »

Nvm, I updated MSYS2's files and copied the libraries again to the executable folder and it worked. There were libraries that wouldn't work and didn't have to do with the OpenAL one, I think.
User avatar
Will_27
Posts: 3
Joined: Tue 15 Feb, 2022 9:56 pm
Location: France

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by Will_27 »

Hi,

I try to compile the latest version of the emulator but it doesn't work. I have this error message :
CMake Error at /usr/share/cmake-3.22.1/Modules/FindwxWidgets.cmake:989 (message):
wxWidgets wx/version.h file not found in
D;/Installation/Applications/msys64/mingw32/lib/wx/include/msw-unicode-3.0;D;/Installation/Applications/msys64/mingw32/include/wx-3.0.
Call Stack (most recent call first):
CMakeLists.txt:93 (find_package)
I used the command 'cmake -G "Ninja" -DMSYS=TRUE -DCMAKE_BUILD_TYPE=Release .' instead of autoreconf and configure because these files are not found... I have followed the guide correctly but impossible to compile the file...

If you have any ideas, you are welcome.
Will
User avatar
Will_27
Posts: 3
Joined: Tue 15 Feb, 2022 9:56 pm
Location: France

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by Will_27 »

Thank you! I was finally able to compile the application correctly from your guide and information from you links.

Here is my detailed and complete procedure to compile PCem for Windows which can update this current guide and help someone who have difficulty.

Install MSYS2 then automatically launch MSYS2 64 bit once installed.

Type :

Code: Select all

pacman -Syu
Install : Yes / Complete Update : Yes
The application must close after installed the updates.

Start MSYS2 MSYS from Windows Start menu and type :

Code: Select all

pacman -Syu
Install : Yes
Install the default development tools :

Code: Select all

pacman -S --needed base-devel mingw-w64-x86_64-toolchain
Default=all (enter) / Install : Yes
Install the tools to get PCem sources from GitHub and for unzip :

Code: Select all

pacman -S git unzip
Install : Yes
Install the prerequisites to build PCem :

Code: Select all

pacman -Sy mingw-w64-{i686,x86_64}-ntldd-git mingw-w64-{i686,x86_64}-toolchain mingw-w64-{i686,x86_64}-SDL2 mingw-w64-{i686,x86_64}-openal mingw-w64-{i686,x86_64}-wxWidgets mingw-w64-{i686,x86_64}-libpcap mingw-w64-{i686,x86_64}-cmake
Default=all (enter) / Install : Yes

Get and download the latest updated sources of PCem from GitHub :

Code: Select all

git clone https://github.com/sarah-walker-pcem/pcem
Close MSYS2 MSYS with this command :

Code: Select all

exit
You can change or update the source code from this path "C:\msys64\home\%username%\pcem".

32 bit compilation

If you want to compile PCEm in 32 Bit then : Launch MSYS2 MinGW x86 from Windows Start menu.

Type :

Code: Select all

cd pcem
mkdir build_x86 && cd build_x86
cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
make
Copy of 32 bit files libraries and compiled application to Release directory :

Code: Select all

cd src && mkdir release && cd release && cp ~/pcem/build_x86/src/pcem.exe ./ && cp /mingw32/bin/libcrypto-1_1.dll ./ && cp /mingw32/bin/libdeflate.dll ./ && cp /mingw32/bin/libexpat-1.dll ./ && cp /mingw32/bin/libgcc_s_dw2-1.dll ./ && cp /mingw32/bin/libjbig-0.dll ./ && cp /mingw32/bin/libjpeg-8.dll ./ && cp /mingw32/bin/libLerc.dll ./ && cp /mingw32/bin/liblzma-5.dll ./ && cp /mingw32/bin/libopenal-1.dll ./ && cp /mingw32/bin/libpcap.dll ./ && cp /mingw32/bin/libpng16-16.dll ./ && cp /mingw32/bin/libssl-1_1.dll ./ && cp /mingw32/bin/libstdc++-6.dll ./ && cp /mingw32/bin/libtiff-5.dll ./ && cp /mingw32/bin/libwebp-7.dll ./ && cp /mingw32/bin/libwinpthread-1.dll ./ && cp /mingw32/bin/libzstd.dll ./ && cp /mingw32/bin/SDL2.dll ./ && cp /mingw32/bin/wxbase30u_gcc_custom.dll ./ && cp /mingw32/bin/wxbase30u_xml_gcc_custom.dll ./ && cp /mingw32/bin/wxmsw30u_adv_gcc_custom.dll ./ && cp /mingw32/bin/wxmsw30u_core_gcc_custom.dll ./ && cp /mingw32/bin/wxmsw30u_html_gcc_custom.dll ./ && cp /mingw32/bin/wxmsw30u_xrc_gcc_custom.dll ./ && cp /mingw32/bin/zlib1.dll ./
Close MSYS2 MSYS with this command :

Code: Select all

exit
You can get the files of the release with Explorer or Run from this path : "C:\msys64\home\%username%\pcem\build_x86\src\release".

64 bit compilation

If you want to compile PCEm in 64 Bit then : Launch MSYS2 MinGW x64 from Windows Start menu.

Type :

Code: Select all

cd pcem
mkdir build_amd64 && cd build_amd64
cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
make
Copy of 64 bit files libraries and compiled application to Release directory :

Code: Select all

cd src && mkdir release && cd release && cp ~/pcem/build_amd64/src/pcem.exe ./ && cp /mingw64/bin/libcrypto-1_1-x64.dll ./ && cp /mingw64/bin/libdeflate.dll ./ && cp /mingw64/bin/libexpat-1.dll ./ && cp /mingw64/bin/libgcc_s_seh-1.dll ./ && cp /mingw64/bin/libjbig-0.dll ./ && cp /mingw64/bin/libjpeg-8.dll ./ && cp /mingw64/bin/libLerc.dll ./ && cp /mingw64/bin/liblzma-5.dll ./ && cp /mingw64/bin/libopenal-1.dll ./ && cp /mingw64/bin/libpcap.dll ./ && cp /mingw64/bin/libpng16-16.dll ./ && cp /mingw64/bin/libssl-1_1-x64.dll ./ && cp /mingw64/bin/libstdc++-6.dll ./ && cp /mingw64/bin/libtiff-5.dll ./ && cp /mingw64/bin/libwebp-7.dll ./ && cp /mingw64/bin/libwinpthread-1.dll ./ && cp /mingw64/bin/libzstd.dll ./ && cp /mingw64/bin/SDL2.dll ./ && cp /mingw64/bin/wxbase30u_gcc_custom.dll ./ && cp /mingw64/bin/wxbase30u_xml_gcc_custom.dll ./ && cp /mingw64/bin/wxmsw30u_adv_gcc_custom.dll ./ && cp /mingw64/bin/wxmsw30u_core_gcc_custom.dll ./ && cp /mingw64/bin/wxmsw30u_html_gcc_custom.dll ./ && cp /mingw64/bin/wxmsw30u_xrc_gcc_custom.dll ./ && cp /mingw64/bin/zlib1.dll ./
Close MSYS2 MSYS with this command :

Code: Select all

exit
You can get the files of the release with Explorer or Run from this path : "C:\msys64\home\%username%\pcem\build_amd64\src\release".

And voilà, you can test your work !
Will
denman00000
Posts: 7
Joined: Sun 05 Jun, 2022 2:42 am

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by denman00000 »

Hi all

Could someone please help ?

What exactly does this mean ?
If you want to compile PCEm in 64 Bit then : Launch MSYS2 MinGW x64 from Windows Start menu.
This is not part of the start menu but can MinGW 64 does exist in the msys64 folder.
When I launch MinGW 64 it opens a shell but the following commands don't work since there is no pcem folder in this shell :-(

Code: Select all

cd pcem
mkdir build_amd64 && cd build_amd64
cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
make
What must I do next in order to successfully compile ?

Really hoping someone can help me.

Thank you in advance
Denman
denman00000
Posts: 7
Joined: Sun 05 Jun, 2022 2:42 am

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by denman00000 »

denman00000 wrote: Sun 05 Jun, 2022 3:07 am Hi all

Could someone please help ?

What exactly does this mean ?
If you want to compile PCEm in 64 Bit then : Launch MSYS2 MinGW x64 from Windows Start menu.
This is not part of the start menu but can MinGW 64 does exist in the msys64 folder.
When I launch MinGW 64 it opens a shell but the following commands don't work since there is no pcem folder in this shell :-(

Code: Select all

cd pcem
mkdir build_amd64 && cd build_amd64
cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
make
What must I do next in order to successfully compile ?

Really hoping someone can help me.

Thank you in advance
Denman
EDIT :
I've made some headway at least .. I found that once you launch (double click ) launch MinGW 64 it opens a shell but you are not place in the root directory of the shell.
So the step that may be missing is

Code: Select all

cd /
then

Code: Select all

cd pcem
mkdir build_amd64 && cd build_amd64
But typing the next command in :

Code: Select all

cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
generates the following :

Code: Select all

$ cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_AR was not found, please set to archive program.
-- Configuring incomplete, errors occurred!

Please can someone help :-( ?\

Denman
JosepMa
Posts: 193
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Sep 2020 ed.] PCem MSYS2 build guide (with wxWidgets)

Post by JosepMa »

If you follow will_27 instructions, you wiinstalling the dependencies that will make that error go away.
Post Reply