Menu

#1709 SDL2 Fails To Build on MSYS2 Windows

v3.x
closed-invalid
nobody
None
SDL2x
Buildsystem
2022-02-25
2022-02-22
Paul Hocker
No

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

Discussion

  • gpz

    gpz - 2022-02-22

    Is this with svn head or the 3.6.1 tarball? If the tarball, try svn head please

     
    • Paul Hocker

      Paul Hocker - 2022-02-22

      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.

       
  • Paul Hocker

    Paul Hocker - 2022-02-22

    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

     
  • gpz

    gpz - 2022-02-22

    compiled fine here in msys2 with your configure line (but using --enable-sdlui2)

     
  • Paul Hocker

    Paul Hocker - 2022-02-22

    it looks like it is building now so it must have been that incorrect parameter i added

     
  • Paul Hocker

    Paul Hocker - 2022-02-22

    ack, now I am getting this error message?

    make[4]: Entering directory '/c/Users/paul/Workspace/retro-coder/vice-mirror/vice/src/monitor'
    cc -DHAVE_CONFIG_H -I. -I../../src  -I../../src/systemheaderoverride -DNDEBUG -mwindows -I../../src/arch/sdl -I../../src/arch/mingw32-pcap/wpcap -I../../src/arch/shared -I../../src -I../../src -I../../src/arch/unix/readline -I../../src/datasette -I../../src/drive -I../../src/imagecontents -I../../src/vdrive -I../../src/tapeport -I../../src/userport -I../../src/joyport -I../../src/lib/p64  -g -O3 -W -Wall -Wextra -Wformat -Wformat-signedness -Wshadow -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wuninitialized -Wunreachable-code -Werror=implicit-function-declaration -Wfatal-errors -Wdiscarded-qualifiers -Wno-unknown-pragmas -Wno-sign-compare -Wno-missing-field-initializers -Wno-ignored-qualifiers -Wno-unused-parameter -Wall -Wno-unused-parameter -Wno-sign-compare -mwindows -fopenmp -Dmain=SDL_main -IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main -IC:/msys64/mingw64/include/SDL2  -Wno-unused-label -Wno-unreachable-code -Wno-misleading-indentation  -MT mon_command.o -MD -MP -MF .deps/mon_command.Tpo -c -o mon_command.o mon_command.c
    mon_command.c:47:10: fatal error: mon_parse.h: No such file or directory
       47 | #include "mon_parse.h"
    
     
  • compyx

    compyx - 2022-02-23

    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).

     
  • Paul Hocker

    Paul Hocker - 2022-02-23

    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

     
  • gpz

    gpz - 2022-02-23

    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)

     
  • Paul Hocker

    Paul Hocker - 2022-02-23

    @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.

     
  • Paul Hocker

    Paul Hocker - 2022-02-24

    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.

    cc -DHAVE_CONFIG_H -I.  -I../src/systemheaderoverride -DNDEBUG -mwindows -I../src/arch/sdl -I../src/arch/mingw32-pcap/wpcap -I../src/arch/shared -I../src -I../src -I../src/c64 -I../src/datasette -I../src/drive -I../src/fsdevice -I../src/monitor -I../src/plus4 -I../src/vic20 -I../src/vdrive -I../src/diskimage -I../src/imagecontents -I../src/diag -I../src/userport -I../src/lib/p64 -I../src/joyport -I../src/rtc -I../src/tapeport -I../src/tape -I../src/socketdrv -I../src/hvsc -I../src/lib/linenoise-ng -I../src/cart  -g -O3 -W -Wall -Wextra -Wformat -Wformat-signedness -Wshadow -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wuninitialized -Wunreachable-code -Werror=implicit-function-declaration -Wfatal-errors -Wdiscarded-qualifiers -Wno-unknown-pragmas -Wno-sign-compare -Wno-missing-field-initializers -Wno-ignored-qualifiers -Wno-unused-parameter -Wall -Wno-unused-parameter -Wno-sign-compare -mwindows -fopenmp -Dmain=SDL_main -IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main -IC:/msys64/mingw64/include/SDL2  -MT info.o -MD -MP -MF .deps/info.Tpo -c -o info.o info.c
    In file included from info.c:34:
    infocontrib.h:36:1: error: expected expression before 'vice_team_t'
       36 | vice_team_t core_team[] = {
          | ^~~~~~~~~~~
    compilation terminated due to -Wfatal-errors.
    make[3]: *** [Makefile:1878: info.o] Error 1
    make[3]: Leaving directory '/c/Users/paul/Workspace/retro-coder/vice-mirror/vice/src'
    make[2]: *** [Makefile:1898: all-recursive] Error 1
    make[2]: Leaving directory '/c/Users/paul/Workspace/retro-coder/vice-mirror/vice/src'
    make[1]: *** [Makefile:1663: all] Error 2
    make[1]: Leaving directory '/c/Users/paul/Workspace/retro-coder/vice-mirror/vice/src'
    make: *** [Makefile:515: all-recursive] Error 1
    
     
  • compyx

    compyx - 2022-02-24

    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:

    1. Start the msys2 mingw64 shell, called "MSYS2 MinGW 64-bit" in the Windows menu, do not use "MSYS2 MSYS", that is the maintenance shell and used for working on msys2 itself. The prompt says "MINGW64", if you see "MSYS" you have the wrong shell.
    2. mkdir tmp
    3. cd tmp
    4. git clone --depth 1 https://github.com/VICE-Team/svn-mirror.git
    5. cd svn-mirror/vice
    6. ./autogen.sh
    7. ./configure --enable-sdlui2 --disable-pdf-docs --disable-html-docs
    8. 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).

     
  • Paul Hocker

    Paul Hocker - 2022-02-24

    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.

     
  • gpz

    gpz - 2022-02-24

    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
  • Paul Hocker

    Paul Hocker - 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.

     
  • Paul Hocker

    Paul Hocker - 2022-02-24

    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
  • Paul Hocker

    Paul Hocker - 2022-02-24

    It worked! I really appreciate your assistance and I hope this thread helps others too.

     
  • Marco van den Heuvel

    since it works now without needing any fixes I will close this as 'invalid'

     
  • Marco van den Heuvel

    • status: open --> closed-invalid
     

Log in to post a comment.