dosbox-staging icon indicating copy to clipboard operation
dosbox-staging copied to clipboard

Error in compiling in msys2

Open strikersix23 opened this issue 3 years ago • 4 comments

This has been an issue for about 4 months now. I have been unable to compile with msys2 due to two errors at link time i have verified the files are there. but the error is this .

"c++" -o dosbox.exe src_winres.rc_winres.o dosbox.exe.p/meson-generated_.._version.cpp.obj dosbox.exe.p/src_main.cpp.obj dosbox.exe.p/src_dosbox.cpp.obj dosbox.exe.p/src_libs_ghc_fs_std_impl.cpp.obj "-Wl,--allow-shlib-undefined" "-Wl,-O1" "-no-pie" "-Wl,--start-group" "src/misc/libmisc.a" "src/libs/loguru/libloguru.a" "src/libs/whereami/libwhereami.a" "src/cpu/libcpu.a" "src/dos/libdos.a" "src/libs/decoders/libdecoders.a" "subprojects/iir1-1.9.3/iir/libiir.a" "src/fpu/libfpu.a" "src/gui/libgui.a" "src/libs/ppscale/libppscale.a" "src/hardware/libhardware.a" "src/libs/nuked/libnuked.a" "src/libs/residfp/libresidfp.a" "src/libs/YM7128B_emu/libym7128bemu.a" "src/libs/zmbv/libzmbv.a" "subprojects/speexdsp-1.2.1/libspeexdsp/libspeexdsp.a" "src/ints/libints.a" "src/midi/libmidi.a" "src/shell/libshell.a" "src/libs/sdlcd/libsdlcd.a" "src/libs/tal-chorus/libtalchorus.a" "-lstdc++fs" "C:/msys64/mingw64/lib/libmingw32.a" "-mwindows" "C:/msys64/mingw64/lib/libSDL2main.a" "C:/msys64/mingw64/lib/libSDL2.dll.a" "-pthread" "C:/msys64/mingw64/lib/libslirp.a" "C:/msys64/mingw64/lib/libws2_32.a" "C:/msys64/mingw64/lib/libiphlpapi.a" "C:/msys64/mingw64/lib/libglib-2.0.a" "C:/msys64/mingw64/lib/libintl.a" "C:/msys64/mingw64/lib/libole32.a" "C:/msys64/mingw64/lib/libwinmm.a" "C:/msys64/mingw64/lib/libshlwapi.a" "C:/msys64/mingw64/lib/libuuid.a" "-lm" "C:/msys64/mingw64/lib/libpcre2-8.a" "-mwindows" "-lstdc++fs" "-lws2_32" "-mwindows" "-mwindows" "-mwindows" "C:/msys64/mingw64/lib/libopusfile.a" "C:/msys64/mingw64/lib/libogg.a" "C:/msys64/mingw64/lib/libopus.a" "C:/msys64/mingw64/lib/libssp.a" "-mwindows" "-lopengl32" "C:/msys64/mingw64/lib/libpng16.a" "C:/msys64/mingw64/lib/libz.a" "-mwindows" "C:/msys64/mingw64/lib/libSDL2_net.dll.a" "-mwindows" "-lws2_32" "-mwindows" "-mwindows" "C:/msys64/mingw64/lib/libdsound.a" "C:/msys64/mingw64/lib/libksuser.a" "/mingw64/lib/libgomp.dll.a" "/mingw64/lib/libmingwthrd.a" "C:/msys64/mingw64/lib/libgthread-2.0.a" "C:/msys64/mingw64/lib/libsndfile.a" "C:/msys64/mingw64/lib/libFLAC.a" "C:/msys64/mingw64/lib/libvorbis.a" "C:/msys64/mingw64/lib/libvorbisenc.a" "C:/msys64/mingw64/lib/libportaudio.a" "-mwindows" "C:/msys64/mingw64/lib/libSDL2.a" "-mwindows" "C:/msys64/mingw64/lib/libuser32.a" "C:/msys64/mingw64/lib/libgdi32.a" "C:/msys64/mingw64/lib/libimm32.a" "C:/msys64/mingw64/lib/liboleaut32.a" "C:/msys64/mingw64/lib/libversion.a" "C:/msys64/mingw64/lib/libadvapi32.a" "C:/msys64/mingw64/lib/libsetupapi.a" "C:/msys64/mingw64/lib/libshell32.a" "C:/msys64/mingw64/lib/libdinput8.a" "C:/msys64/mingw64/lib/libreadline.a" "C:/msys64/mingw64/lib/libtermcap.a" "-LC:/msys64/mingw64/lib" "-lfluidsynth" "-LC:/msys64/mingw64/lib" "-lmt32emu" "-lwinmm" "-mwindows" "-mwindows" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32" "-Wl,--end-group" C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /mingw64/lib/libgomp.dll.a: No such file or directory C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /mingw64/lib/libmingwthrd.a: No such file or directory collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed.

strikersix23 avatar Sep 20 '22 15:09 strikersix23

The "/mingw64/lib/libgomp.dll.a" and "/mingw64/lib/libmingwthrd.a" libraries are specified without a C:/msys64/ prefix, unlike the other libraries.

If those files do exist, then it's probably this missing prefix that's the problem - and probably a bug in GCC's pkg-config record.

There are many team members successfully building with MSYS2, so this should be solvable. Our Windows CI VMs also build releases using the same steps.

What I can suggest is following https://github.com/dosbox-staging/dosbox-staging/blob/main/docs/build-windows.md#build-using-msys2 very closely.

Although CI builds with both GCC and Clang, we use Clang specifically for our releases. So I would suggest following those notes for the Clang pathway, and try using it.

kcgen avatar Sep 20 '22 18:09 kcgen

Clang also had that error so I wonder if it was pkg-conf, cmake requires pkgconf so I wonder if that can be the issue

strikersix23 avatar Sep 20 '22 19:09 strikersix23

Odd I got it to compile using older build instructions but it seg faults on commit 0efd3da from Jan 1st but had to disable any mentions in meson about libslirp internally, so it doesn't compile it. It is installed though.

command

meson setup build/release-gcc -Dbuildtype=release -Db_asneeded=true --force-fallback-for=fluidsynth,mt32emu -Dtry_static_libs=fluidsynth,mt32emu,opusfile,png -Dfluidsynth:try-static-deps=true

strikersix23 avatar Sep 20 '22 19:09 strikersix23

Everything fails on my system I tested it on 2 other windows PCs that use the msys installer followed the build guide exactly fails all the time

strikersix23 avatar Sep 20 '22 20:09 strikersix23

@strikersix23 Any updates on this? If yes, simply reopen!

Burrito78 avatar May 13 '23 14:05 Burrito78