devinacker / bsnes-plus

debug-oriented fork of bsnes
http://bsnes.revenant1.net
327 stars 92 forks source link

Windows build - Compilation error on snesreader moc files #351

Closed Krokodyl closed 1 year ago

Krokodyl commented 1 year ago

Hello,

I get this error when I try to compile the current branch.

Compiling snes/chip/sa1/sa1.cpp...
Compiling snes/chip/necdsp/necdsp.cpp...
Compiling snes/chip/bsx/bsx.cpp...
Compiling snes/chip/srtc/srtc.cpp...
Compiling snes/chip/sdd1/sdd1.cpp...
Compiling snes/chip/spc7110/spc7110.cpp...
Compiling snes/chip/cx4/cx4.cpp...
Compiling snes/chip/obc1/obc1.cpp...
Compiling snes/chip/st0018/st0018.cpp...
Compiling snes/chip/msu1/msu1.cpp...
Compiling snes/chip/serial/serial.cpp...
Linking out/bsnes...
make[1]: Entering directory 'D:/emulation/git/bsnes-plus/snesreader'
../external/qt/mingw-w64/bin/moc -i filechooser.moc.hpp -o obj/filechooser.moc
make[1]: *** [Makefile:66: obj/filechooser.moc] Error -1073741515
make[1]: Leaving directory 'D:/emulation/git/bsnes-plus/snesreader'
make: *** [Makefile:134: plugins] Error 2
D:/emulation/git/bsnes-plus/bsnes $

I'm using Windows 10, w64devkit-1.18.0. I cloned the repo with git bash, and activated the submodule with 'git submodule update --init --recursive'. I get the error when running mingw32-make.exe from w64devkit-1.18.0. I also tried to run mingw32-make.exe from git bash (mingw64) but I can't even start the compilation (Qt5 files are not found despite the fact that the submodule folders are in the $PATH). Should I just install Visual Studio and QT5 directly?

devinacker commented 1 year ago

It's strange that moc apparently works fine for bsnes itself but not for the plugins. If you run mingw32-make build (which skips building the optional plugins)` does bsnes itself build and link successfully?

I also tried to run mingw32-make.exe from git bash (mingw64) but I can't even start the compilation (Qt5 files are not found despite the fact that the submodule folders are in the $PATH).

Try passing platform=win to mingw32-make to force the build to use the prebuilt Windows Qt binaries. (I may need to fix platform detection for mingw64)

Krokodyl commented 1 year ago

Both solutions worked! I can build the exe now. Thanks.

dinkc64 commented 7 months ago

I wasted so much time trying to get this to build. fortunately the answer was in a closed issue :)