Author Topic: Simplified Windows native compile w/ MSYS2  (Read 6131 times)

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Simplified Windows native compile w/ MSYS2
« on: September 08, 2015, 09:58:15 PM »
I smacked my head many times trying to get mingw/msys installed with dependencies and  correctly compile AM on Windows natively. This was by far the easiest method and handles all dependencies:

Code: [Select]
Install MSYS2
    https://msys2.github.io/
Launch MSYS2 Shell:
    First, update the system:
    pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
    Close MSYS2 Shell, and run it again
    pacman -Syu
Install requirements ( optionally use mingw-w64-i686-toolchain depending on arch ):
pacman -S git mingw-w64-x86_64-toolchain msys/make mingw64/mingw-w64-x86_64-sfml mingw64/mingw-w64-x86_64-ffmpeg
    [ hit enter to default all installed ]

Clone and Make:
    git clone https://github.com/mickelson/attract
    cd attract
    make

The only thing I don't understand is the required dll's after install. If you add C:\msys64\mingw64\bin to your PATH, it works fine. Is there a way for the required dlls to be included along with the app for a standalone installation?

If these are acceptable, perhaps they can replace the current Native Windows compile instructions on github and a native compile can finally be "supported" :)

https://github.com/mickelson/attract/blob/master/Compile.md#windows-native-compile


raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
Re: Simplified Windows native compile w/ MSYS2
« Reply #1 on: September 11, 2015, 10:53:12 PM »
Thanks for the research liquid8d, this looks like a good approach for windows native builds.  I'll try this out here and see if there is something easy that can be done to make it a static build so you don't have the dll problems...

cheers

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: Simplified Windows native compile w/ MSYS2
« Reply #2 on: March 16, 2017, 03:33:50 PM »
Sorry for diging out the topic, but I would like to know what should I do to force compiler to include all the required dlls in the attract.exe

djrobx

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Re: Simplified Windows native compile w/ MSYS2
« Reply #3 on: March 17, 2017, 06:49:16 PM »
Thanks!!  I tried and failed with the included instructions too.   I was getting issues with SMFL not building correctly.

I ended up installing MAME Compiler, and then using the build environment from that (which is just another MSYS2 install).  For whatever reason SFML had no problem there.  So now I can build both MAME and Attract Mode from the same toolset which is nice.

There has to be a way to get it to include static libraries.  MAME does with the same build environment.

The DLL list is pretty long, but here they are if you want to copy them.  In my case I have the build tools on my standard mechanical HDD, so I wanted to copy the DLLs to the SSD.   Here was the minimum list I came up with:

Code: [Select]
avcodec-57.dll
avformat-57.dll
avutil-55.dll
libarchive-13.dll
libbluray-1.dll
libbz2-1.dll
libcelt0-2.dll
libexpat-1.dll
libffi-6.dll
libfreetype-6.dll
libgcc_s_seh-1.dll
libglib-2.0-0.dll
libgmp-10.dll
libgnutls-30.dll
libgraphite2.dll
libgsm.dll
libharfbuzz-0.dll
libhogweed-4.dll
libiconv-2.dll
libidn-11.dll
libintl-8.dll
libjpeg-8.dll
liblz4.dll
liblzma-5.dll
liblzo2-2.dll
libmodplug-1.dll
libmp3lame-0.dll
libnettle-6.dll
libogg-0.dll
libopenal-1.dll
libopencore-amrnb-0.dll
libopencore-amrwb-0.dll
libopenjp2-7.dll
libopenjp3d-7.dll
libopenjpip-7.dll
libopenjpwl-7.dll
libopenmj2-7.dll
libopus-0.dll
liborc-0.4-0.dll
libp11-kit-0.dll
libpcre-1.dll
libpng16-16.dll
librtmp-1.dll
libschroedinger-1.0-0.dll
libspeex-1.dll
libstdc++-6.dll
libtasn1-6.dll
libtheora-0.dll
libtheoradec-1.dll
libtheoraenc-1.dll
libunistring-2.dll
libvorbis-0.dll
libvorbisenc-2.dll
libvorbisfile-3.dll
libvpx-1.dll
libwavpack-1.dll
libwebp-6.dll
libwebpmux-2.dll
libwinpthread-1.dll
libx264-148.dll
libx265.dll
libx265_main10.dll
libxml2-2.dll
sfml-audio-2.dll
sfml-graphics-2.dll
sfml-network-2.dll
sfml-system-2.dll
sfml-window-2.dll
swresample-2.dll
swscale-4.dll
xvidcore.dll
zlib1.dll

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: Simplified Windows native compile w/ MSYS2
« Reply #4 on: March 18, 2017, 08:24:42 AM »
I gave up. I'm Installing Ubuntu on a VM

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: Simplified Windows native compile w/ MSYS2
« Reply #5 on: March 19, 2017, 02:21:46 AM »
I'm not experienced in compliling on linux so I will going to need a little help here. I have no idea of where all the files need to be located. I compiled mxe and its located in the opt folder but I get errors when I try to compile AM

Code: [Select]
root@ubuntu:/home/oomek/Documents/attract# make -j 3 CROSS=1 TOOLCHAIN=x86_64-w64-mingw32.static WINDOWS_STATIC=1
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
make: x86_64-w64-mingw32.static-pkg-config: Command not found
/bin/sh: 1: x86_64-w64-mingw32.static-pkg-config: not found
make: x86_64-w64-mingw32.static-pkg-config: Command not found
flags: -DSFML_STATIC  -IC:/Users/Radek/Desktop/SFML/SFML/include -LC:/Users/Radek/Desktop/SFML/SFML/lib -lopengl32 -lwinmm -lgdi32 -lfreetype -ljpeg -static-libgcc -static-libstdc++ -mconsole -O2 -DNDEBUG -Iextlibs/miniz -Iextlibs/audio/include -D__STDC_CONSTANT_MACROS  -Iextlibs/expat -Iextlibs/squirrel/include -Iextlibs/sqrat/include -Iextlibs/gameswf
Creating executable: attract.exe

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: Simplified Windows native compile w/ MSYS2
« Reply #6 on: March 19, 2017, 02:57:25 AM »
Ok , I forgot to set the PATH to MXE and now I've got another error:

Code: [Select]
/opt/mxe/usr/bin/x86_64-w64-mingw32.static-pkg-config: 2: exec: /home/oomek/Documents/mxe/usr/x86_64-unknown-linux-gnu/bin/pkgconf: not found

pkgconf is located in
Code: [Select]
/opt/mxe/usr/x86_64-unknown-linux-gnu/bin/How do I make the compiler to look there for it?
« Last Edit: March 19, 2017, 02:59:35 AM by Oomek »

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Re: Simplified Windows native compile w/ MSYS2
« Reply #7 on: March 19, 2017, 09:12:48 AM »
Here's another set of errors:

Code: [Select]
oomek@ubuntu:~/Documents/attract-master$ make -j 3 CROSS=1 TOOLCHAIN=x86_64-w64-mingw32.static WINDOWS_STATIC=1
Package sfml-system was not found in the pkg-config search path.
Perhaps you should add the directory containing `sfml-system.pc'
to the PKG_CONFIG_PATH environment variable
Package 'sfml-system', required by 'world', not found
Package 'sfml-window', required by 'world', not found
Package 'sfml-graphics', required by 'world', not found
Package 'sfml-network', required by 'world', not found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'freetype2', required by 'world', not found
Package 'libavformat', required by 'world', not found
Package 'libavcodec', required by 'world', not found
Package 'libavutil', required by 'world', not found
Package 'libswscale', required by 'world', not found
Package 'openal', required by 'world', not found


Anyone? please, help, or end my suffering