mamedev / mame

MAME
https://www.mamedev.org/
Other
7.95k stars 1.98k forks source link

MAME Failing to build with emscripten Error: no member named 'construct' #12669

Open Alex9532 opened 3 weeks ago

Alex9532 commented 3 weeks ago

MAME version

0.268

System information

MacOS Catalina 10.15.7 iMac14,2 32 GB Ram

INI configuration details

emmake SUBTARGET=simpbowlv1 SOURCES=src/mame/konami/konamigv.cpp WEBASSEMBLY=1

Emulated system/software

No response

Incorrect behaviour

Build Failed because construct is not a member in 'optional<type-parameter-0-0 &>'

Expected behaviour

For the build to succeed. This happened running with NOWERROR too

Steps to reproduce

  1. Started a MAME Build. 2: Waited. I don't know why this happened

Additional details

[...] Compiling 3rdparty/flac/src/libFLAC/stream_encoder_intrin_ssse3.c... Compiling 3rdparty/flac/src/libFLAC/window.c... Archiving libflac.a... Compiling src/lib/formats/all.cpp... Compiling src/lib/formats/cassimg.cpp... Compiling src/lib/formats/cqm_dsk.cpp... Compiling src/lib/formats/d88_dsk.cpp... Compiling src/lib/formats/dfi_dsk.cpp... Compiling src/lib/formats/dsk_dsk.cpp... Compiling src/lib/formats/fdi_dsk.cpp... Compiling src/lib/formats/flacfile.cpp... Compiling src/lib/formats/flopimg.cpp... Compiling src/lib/formats/flopimg_legacy.cpp... Compiling src/lib/formats/fs_unformatted.cpp... Compiling src/lib/formats/fsblk.cpp... Compiling src/lib/formats/fsblk_vec.cpp... Compiling src/lib/formats/fsmeta.cpp... Compiling src/lib/formats/fsmgr.cpp... Compiling src/lib/formats/hxchfe_dsk.cpp... Compiling src/lib/formats/hxcmfm_dsk.cpp... Compiling src/lib/formats/imageutl.cpp... Compiling src/lib/formats/imd_dsk.cpp... Compiling src/lib/formats/ipf_dsk.cpp... Compiling src/lib/formats/mfi_dsk.cpp... Compiling src/lib/formats/pc_dsk.cpp... Compiling src/lib/formats/rpk.cpp... Compiling src/lib/formats/td0_dsk.cpp... Compiling src/lib/formats/upd765_dsk.cpp... Compiling src/lib/formats/wavfile.cpp... Archiving libformats.a... Compiling src/frontend/mame/audit.cpp... Compiling src/frontend/mame/cheat.cpp... Compiling src/frontend/mame/clifront.cpp... In file included from ../../../../../src/frontend/mame/clifront.cpp:19: In file included from ../../../../../src/frontend/mame/luaengine.h:31: ../../../../../3rdparty/sol2/sol/sol.hpp:6755:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>' 6755 | this->construct(std::forward(args)...); | ~~~~ ^ 1 error generated. make[2]: [../../../../asmjs/obj/Release/src/frontend/mame/clifront.o] Error 1 make[1]: [frontend] Error 2 make: *** [asmjs] Error 2 emmake: error: 'make SUBTARGET=simpbowlv1 SOURCES=src/mame/konami/konamigv.cpp' failed (returned 2)

holub commented 3 weeks ago

./emsdk install 3.1.28 ./emsdk activate 3.1.28

Alex9532 commented 3 weeks ago

What does this do? Install a newer version? I also added emsdk to path. I looks like it's working so far...

Alex9532 commented 3 weeks ago

I now get this:

fatal error: malformed or corrupted AST file: 'malformed block record in AST file' 1 error generated. em++: error: '/Users/User/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -emscripten-cxx-exceptions-allowed=_ZN15running_machine17start_all_devicesEv,_ZN12cli_frontend7executeEiPPc,_ZN8chd_file11open_commonEb,_ZN8chd_file13read_metadataEjjRNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE,_ZN8chd_file13read_metadataEjjRNSt326vectorIhNS0_9allocatorIhEEEE,_ZNK19netlist_mame_device19base_validity_checkER16validity_checker -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -I/Users/User/emsdk/upstream/emscripten/cache/sysroot/include/SDL -I/Users/User/emsdk/upstream/emscripten/cache/sysroot/include/freetype2 -I/Users/User/emsdk/upstream/emscripten/cache/sysroot/include/SDL2 -I/Users/User/emsdk/upstream/emscripten/cache/sysroot/include/harfbuzz -DTTF_USE_HARFBUZZ=1 --sysroot=/Users/User/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -MMD -MP -MP -DNDEBUG -DCRLF=2 -DLSB_FIRST -DFLACNO_DLL -DPUGIXML_HEADER_ONLY -DMAME_NOASM -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DASIO_HAS_PTHREADS -DUI_SDL -I../../../../../src/osd -I../../../../../src/emu -I../../../../../src/frontend/mame -I../../../../../src/devices -I../../../../../src/lib -I../../../../../src/lib/util -I../../../../../3rdparty -I../../../../../3rdparty/sol2 -I../../../../generated/emu -I../../../../generated/emu/layout -I../../../../../3rdparty/asio/include -I../../../../../3rdparty/expat/lib -I../../../../../3rdparty/lua/src -I../../../../../3rdparty/zlib -I../../../../../3rdparty/flac/include -I../../../../../3rdparty/rapidjson/include -std=c++17 -pipe -Werror -O3 -fno-strict-aliasing -Wno-unknown-pragmas -Wall -Wcast-align -Wformat-security -Wundef -Wwrite-strings -Wno-conversion -Wno-sign-compare -Wno-error=deprecated-declarations -fdiagnostics-show-note-include-stack -Wno-cast-align -Wno-constant-logical-operand -Wno-extern-c-compat -Wno-ignored-qualifiers -Wno-pragma-pack -Wno-tautological-compare -Wno-unknown-attributes -Wno-unknown-warning-option -Wno-unused-value -Wno-unused-const-variable -Wno-xor-used-as-pow -Wno-bitwise-instead-of-logical -Wno-self-assign-field -Wno-format-security -Wno-inline-new-delete -Wno-absolute-value -std=gnu89 -Wno-implicit-function-declaration -std=c++17 -Woverloaded-virtual -Wvla -include ../../../../asmjs/obj/Release/emu.h -c ../../../../../src/frontend/mame/clifront.cpp -o ../../../../asmjs/obj/Release/src/frontend/mame/clifront.o' failed (returned 1) make[2]: [../../../../asmjs/obj/Release/src/frontend/mame/clifront.o] Error 1 make[1]: [frontend] Error 2 make: *** [asmjs] Error 2 emmake: error: 'make SUBTARGET=simpbowlv2 SOURCES=src/mame/konami/konamigv.cpp WEBASSEMBLY=1' failed (returned 2)

DopefishJustin commented 3 weeks ago

Did you make clean after changing the emsdk version?

nguillaumin commented 2 days ago

I'm having the same issue, even after having installed and activated the 3.1.28 SDK + make clean.

I found this that might be related? https://github.com/ThePhD/sol2/commit/d805d027e0a0a7222e936926139f06e23828ce9f

JakubSakar9 commented 2 hours ago

I encountered the same issue. The fix that @nguillaumin was referring to has resolved it for me.