gan74 / Yave

Yet Another Vulkan Engine
MIT License
470 stars 20 forks source link

Failed to build on MSYS2 MINGW64 #11

Open ghost opened 1 year ago

ghost commented 1 year ago

Please have a look. There are too many errors so I can't post it here. Thank you.

gan74 commented 1 year ago

Hi, I was just able to try compiling with MSYS2 in a long while, and I am running into problem compiling LuaJIT.

Are your error related to LuaJIT or the engine itself ?

ghost commented 1 year ago

Actually they are not errors but warnings. There are too many warning and as ninja by default does parallel builds so I mistake them as full of errors. Indeed there is only one error:

[23/234] Building CXX object CMakeFiles/yave.dir/yave/components/LocalLightBase.cpp.obj
FAILED: CMakeFiles/yave.dir/yave/components/LocalLightBase.cpp.obj
C:\msys64\mingw64\bin\c++.exe  -IC:/msys64/home/Administrator/Yave/build -IC:/msys64/home/Administrator/Yave -IC:/msys64/home/Administrator/Yave/y -IC:/msys64/home/Administrator/Yave/external/sol/include -IC:/msys64/home/Administrator/Yave/external/LuaJIT/src -IC:/msys64/home/Administrator/Yave/external/spirv_cross -DTRACY_ENABLE -pedantic -Wall -Wextra -Wzero-as-null-pointer-constant -Wfloat-conversion -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wredundant-decls -Wundef -Wno-gnu-zero-variadic-macro-arguments -DY_DEBUG -MD -MT CMakeFiles/yave.dir/yave/components/LocalLightBase.cpp.obj -MF CMakeFiles\yave.dir\yave\components\LocalLightBase.cpp.obj.d -o CMakeFiles/yave.dir/yave/components/LocalLightBase.cpp.obj -c C:/msys64/home/Administrator/Yave/yave/components/LocalLightBase.cpp
In file included from C:/msys64/home/Administrator/Yave/yave/ecs/ComponentInspector.h:25,
                 from C:/msys64/home/Administrator/Yave/yave/components/LocalLightBase.cpp:25:
C:/msys64/home/Administrator/Yave/yave/ecs/ecs.h:135:13: error: 'hash' is not a class template
  135 | struct std::hash<yave::ecs::EntityId> : std::hash<y::u64> {
      |             ^~~~
C:/msys64/home/Administrator/Yave/yave/ecs/ecs.h:135:39: error: qualified name does not name a class before ':' token
  135 | struct std::hash<yave::ecs::EntityId> : std::hash<y::u64> {
      |                                       ^
C:/msys64/home/Administrator/Yave/yave/ecs/ecs.h:135:39: error: expected '{' before ':' token
In file included from C:/msys64/home/Administrator/Yave/yave/assets/AssetTraits.h:25,
                 from C:/msys64/home/Administrator/Yave/yave/assets/AssetId.h:26,
                 from C:/msys64/home/Administrator/Yave/yave/assets/AssetPtr.h:25,
                 from C:/msys64/home/Administrator/Yave/yave/ecs/ComponentInspector.h:27:
C:/msys64/home/Administrator/Yave/y/y/reflect/reflect.h:177:21: warning: extra ';' [-Wpedantic]
  177 | y_reflect_base(Type);                                                                                       \
      |                     ^
C:/msys64/home/Administrator/Yave/y/y/reflect/reflect.h:184:33: note: in expansion of macro 'y_reflect_static'
  184 | #define y_reflect(Type, ...)    y_reflect_static(Type, __VA_ARGS__)
      |                                 ^~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/Yave/yave/assets/AssetPtr.h:176:9: note: in expansion of macro 'y_reflect'
  176 |         y_reflect(AssetPtr, _id)
      |         ^~~~~~~~~
cc1plus.exe: note: unrecognized command-line option '-Wno-gnu-zero-variadic-macro-arguments' may have been intended to silence earlier diagnostics
ninja: build stopped: subcommand failed.
gan74 commented 1 year ago

This looks like an include problem. Can you try including <functional> in ecs.h?