SDL2 Fails To Build on MSYS2 Windows
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
When trying to compile for Windows using MSYS2/MinGW the following errors occurs during make
$ make 2>&1 | tee build.log
Making all in src
make[1]: Entering directory '/c/Users/paul/Workspace/retro-coder/vice-mirror/vice/src'
generating infocontrib.h
cat: coreteam.tmp: No such file or directory
cat: exteam.tmp: No such file or directory
cat: docteam.tmp: No such file or directory
cat: transteam.tmp: No such file or directory
ERROR: generated infocontrib.h contains content that is not valid iso-8859-x
make[1]: *** [Makefile:2298: infocontrib.h] Error 1
make[1]: Leaving directory '/c/Users/paul/Workspace/retro-coder/vice-mirror/vice/src'
make: *** [Makefile:515: all-recursive] Error 1
Here my configuration options (which worked with no errors)
$ ./configure -C --enable-native-tools --enable-native-sdlui2 --enable-cpuhistory --disable-catweasel --disable-lame --disable-rs232 --disable-hardsid --disable-parsid --enable-ethernet --enable-x64 --disable-debug --disable-pdf-docs --without-ogg-vorbis --without-flac
Contents of generated??? file (without comments)
#ifndef VICE_INFOCONTRIB_H
#define VICE_INFOCONTRIB_H
const char info_contrib_text[] =
vice_team_t core_team[] = {
{ NULL, NULL, NULL }
};
vice_team_t ex_team[] = {
{ NULL, NULL, NULL }
};
char *doc_team[] = {
NULL
};
vice_trans_t trans_team[] = {
{ NULL, NULL, NULL, NULL }
};
#endif
Is this with svn head or the 3.6.1 tarball? If the tarball, try svn head please
svn head
Well, technically I am using the mirror on Gthub, but that should not make a difference.
Also, please see note that I may have configured incorrectly.
I think I may have messed up my configuration by using --enable-native-sdlui2 instead of just --enable-sdlui2
I am rebuilding and will see if that helps with the error
compiled fine here in msys2 with your configure line (but using --enable-sdlui2)
it looks like it is building now so it must have been that incorrect parameter i added
ack, now I am getting this error message?
I'd run
make distclean
followed by./autogen.sh
to clean up any left-over configure data and rebuild configure and then run./configure --enable-sdlui2
(no-C
to cache results, no--enable-native-tools
which was dropped a long time ago).Thanks @compyx I am trying that now.
Is there a way to configure it so that it only builds the windows binaries? I am not interested to building the entire package I only want to test some changes on windows until I know it works.
Thx
what do you mean "only the windows binaries"? If you compile it in msys, you will get windows .exe binaries (unless you are using some fancy cross compiler setup - but you'll know if you were doing this)
@gpz okay sounds good, I thought when I was trying to compile it said something about building for Android and some other platforms. Just making sure. Thx.
i feel like I am getting closer? there must be some kind of weird thing with windows 11 causing all these problems? I think I might try doing it on Linux just to see it work.
Odd. Might be Windows 11 related, but I think one of us has used Windows 11 with msys2 to build VICE.
The steps I did in a Win7 VM to check out the svn mirror and build the SDL2 port are the following:
mkdir tmp
cd tmp
git clone --depth 1 https://github.com/VICE-Team/svn-mirror.git
cd svn-mirror/vice
./autogen.sh
./configure --enable-sdlui2 --disable-pdf-docs --disable-html-docs
make -j3 -s --no-print-directory
This correctly builds VICE and I can run
src/x64sc -directory data/
to run x64sc.I just noticed you're not using a directory inside the msys2 tree, but rather a directory in your Windows home directory, perhaps cloned with git-for-windows or so. This might cause issues with file encodings (Unix LF vs Windows CRLF, UTF-8 vs whatever Windows uses). This could make geninfocontrib.h to fail to properly parse vice.texi for the infocontrib.h file and might also explain why mon_parse.h wasn't found, byacc/flex getting incorrectl encodings for their input files.
So please follow the steps I mentioned: use a directory inside msys2's home/ directory and use git from the msys2 mingw64 shell (
pacman -S git
).Thanks @compyx -- I have been using MinGW so we are good there. I will give this a shot.
The configure step took a VERY long time, hours and hours. It might be because of Win11 but how long does the above steps take for you usually?
FWIW I have a AMD 3700x with 32gb RAM
SSD drive for the build
Thanks again for the help.
Windows is to blame there in general - it's just super slow in msys. It takes no more than a few minutes at best on my linux box, and like an hour on my windows laptop. Using WSL instead might speed it up, i don't know, never tried.
Try putting an exception for the msys tree in windows defender, and exclude it from any virus scanning, that might speed it up a bit
Last edit: gpz 2022-02-24
Appreciate all the help. I am trying the above steps again with Defender exceptions, we will see how it goes.
Off topic, are people using Visual Studio at all to do development or something else in Windows?
Just curious.
Thanks.
Wow! Adding those exceptions for Defender -- it's like night and day difference. Thank you @gpz!
Edit: The entire configure process took a little over 5 minutes to complete. I am blown away.
On to the next step.
Last edit: Paul Hocker 2022-02-24
It worked! I really appreciate your assistance and I hope this thread helps others too.
since it works now without needing any fixes I will close this as 'invalid'