Closed ghost closed 1 year ago
It looks like glslang failed to compile, resulting in libglslang.a not being generated, check if there are any other errors before the link error
It looks like glslang failed to compile, resulting in libglslang.a not being generated, check if there are any other errors before the link error
The error above only happens with Ninja generator. Use MSYS Makefiles generator worked. But glslang
still failed to build:
$ make
[ 0%] Building CXX object third_party/glslang/OGLCompilersDLL/CMakeFiles/OGLCompiler.dir/InitializeDll.cpp.obj
[ 0%] Linking CXX static library libOGLCompilerd.a
[ 0%] Built target OGLCompiler
[ 0%] Building CXX object third_party/glslang/glslang/CMakeFiles/GenericCodeGen.dir/GenericCodeGen/CodeGen.cpp.obj
[ 0%] Building CXX object third_party/glslang/glslang/CMakeFiles/GenericCodeGen.dir/GenericCodeGen/Link.cpp.obj
[ 1%] Linking CXX static library libGenericCodeGend.a
[ 1%] Built target GenericCodeGen
[ 2%] Building CXX object third_party/glslang/glslang/OSDependent/Windows/CMakeFiles/OSDependent.dir/ossource.cpp.obj
[ 2%] Linking CXX static library libOSDependentd.a
[ 2%] Built target OSDependent
[ 2%] Building CXX object third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/glslang_tab.cpp.obj
In file included from MachineIndependent/glslang.y:86:
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:649:18: error: 'uint32_t' does not name a type
649 | static const uint32_t LevelFlagBitOffset = 56;
| ^~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:71:1: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
70 | #include "../Include/InfoSink.h"
+++ |+#include <cstdint>
71 |
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:662:22: error: 'uint64_t' does not name a type
662 | static constexpr uint64_t uniqueIdMask = (1LL << LevelFlagBitOffset) - 1;
| ^~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:662:22: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:663:18: error: 'uint32_t' does not name a type
663 | static const uint32_t MaxLevelInUniqueID = 127;
| ^~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:663:18: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h: In static member function 'static bool glslang::TSymbolTable::isBuiltInSymbol(long long int)':
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:659:50: error: 'LevelFlagBitOffset' was not declared in this scope
659 | int level = static_cast<int>(uniqueId >> LevelFlagBitOffset);
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h: In member function 'void glslang::TSymbolTable::amendSymbolIdLevel(glslang::TSymbol&)':
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:735:9: error: 'uint64_t' was not declared in this scope
735 | uint64_t level = (uint32_t)currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel();
| ^~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:735:9: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:736:18: error: expected ';' before 'symbolId'
736 | uint64_t symbolId = symbol.getUniqueId();
| ^~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:737:9: error: 'symbolId' was not declared in this scope; did you mean 'symbol'?
737 | symbolId &= uniqueIdMask;
| ^~~~~~~~
| symbol
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:737:21: error: 'uniqueIdMask' was not declared in this scope; did you mean 'uniqueId'?
737 | symbolId &= uniqueIdMask;
| ^~~~~~~~~~~~
| uniqueId
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:738:22: error: 'level' was not declared in this scope
738 | symbolId |= (level << LevelFlagBitOffset);
| ^~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:738:31: error: 'LevelFlagBitOffset' was not declared in this scope
738 | symbolId |= (level << LevelFlagBitOffset);
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h: In member function 'void glslang::TSymbolTable::updateUniqueIdLevelFlag()':
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:932:9: error: 'uint64_t' was not declared in this scope
932 | uint64_t level = (uint32_t)currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel();
| ^~~~~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:932:9: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:933:21: error: 'uniqueIdMask' was not declared in this scope; did you mean 'uniqueId'?
933 | uniqueId &= uniqueIdMask;
| ^~~~~~~~~~~~
| uniqueId
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:934:22: error: 'level' was not declared in this scope
934 | uniqueId |= (level << LevelFlagBitOffset);
| ^~~~~
C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:934:31: error: 'LevelFlagBitOffset' was not declared in this scope
934 | uniqueId |= (level << LevelFlagBitOffset);
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/build.make:76: third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/glslang_tab.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:375: third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
MSYS2 already has glslang
packaged, what about just using it?
It looks like glslang failed to compile, resulting in libglslang.a not being generated, check if there are any other errors before the link error
The error above only happens with Ninja generator. Use MSYS Makefiles generator worked. But
glslang
still failed to build:$ make [ 0%] Building CXX object third_party/glslang/OGLCompilersDLL/CMakeFiles/OGLCompiler.dir/InitializeDll.cpp.obj [ 0%] Linking CXX static library libOGLCompilerd.a [ 0%] Built target OGLCompiler [ 0%] Building CXX object third_party/glslang/glslang/CMakeFiles/GenericCodeGen.dir/GenericCodeGen/CodeGen.cpp.obj [ 0%] Building CXX object third_party/glslang/glslang/CMakeFiles/GenericCodeGen.dir/GenericCodeGen/Link.cpp.obj [ 1%] Linking CXX static library libGenericCodeGend.a [ 1%] Built target GenericCodeGen [ 2%] Building CXX object third_party/glslang/glslang/OSDependent/Windows/CMakeFiles/OSDependent.dir/ossource.cpp.obj [ 2%] Linking CXX static library libOSDependentd.a [ 2%] Built target OSDependent [ 2%] Building CXX object third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/glslang_tab.cpp.obj In file included from MachineIndependent/glslang.y:86: C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:649:18: error: 'uint32_t' does not name a type 649 | static const uint32_t LevelFlagBitOffset = 56; | ^~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:71:1: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'? 70 | #include "../Include/InfoSink.h" +++ |+#include <cstdint> 71 | C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:662:22: error: 'uint64_t' does not name a type 662 | static constexpr uint64_t uniqueIdMask = (1LL << LevelFlagBitOffset) - 1; | ^~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:662:22: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'? C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:663:18: error: 'uint32_t' does not name a type 663 | static const uint32_t MaxLevelInUniqueID = 127; | ^~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:663:18: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'? C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h: In static member function 'static bool glslang::TSymbolTable::isBuiltInSymbol(long long int)': C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:659:50: error: 'LevelFlagBitOffset' was not declared in this scope 659 | int level = static_cast<int>(uniqueId >> LevelFlagBitOffset); | ^~~~~~~~~~~~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h: In member function 'void glslang::TSymbolTable::amendSymbolIdLevel(glslang::TSymbol&)': C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:735:9: error: 'uint64_t' was not declared in this scope 735 | uint64_t level = (uint32_t)currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel(); | ^~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:735:9: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'? C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:736:18: error: expected ';' before 'symbolId' 736 | uint64_t symbolId = symbol.getUniqueId(); | ^~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:737:9: error: 'symbolId' was not declared in this scope; did you mean 'symbol'? 737 | symbolId &= uniqueIdMask; | ^~~~~~~~ | symbol C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:737:21: error: 'uniqueIdMask' was not declared in this scope; did you mean 'uniqueId'? 737 | symbolId &= uniqueIdMask; | ^~~~~~~~~~~~ | uniqueId C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:738:22: error: 'level' was not declared in this scope 738 | symbolId |= (level << LevelFlagBitOffset); | ^~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:738:31: error: 'LevelFlagBitOffset' was not declared in this scope 738 | symbolId |= (level << LevelFlagBitOffset); | ^~~~~~~~~~~~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h: In member function 'void glslang::TSymbolTable::updateUniqueIdLevelFlag()': C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:932:9: error: 'uint64_t' was not declared in this scope 932 | uint64_t level = (uint32_t)currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel(); | ^~~~~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:932:9: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'? C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:933:21: error: 'uniqueIdMask' was not declared in this scope; did you mean 'uniqueId'? 933 | uniqueId &= uniqueIdMask; | ^~~~~~~~~~~~ | uniqueId C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:934:22: error: 'level' was not declared in this scope 934 | uniqueId |= (level << LevelFlagBitOffset); | ^~~~~ C:/msys64/home/Administrator/SoftGLRender/third_party/glslang/glslang/MachineIndependent/SymbolTable.h:934:31: error: 'LevelFlagBitOffset' was not declared in this scope 934 | uniqueId |= (level << LevelFlagBitOffset); | ^~~~~~~~~~~~~~~~~~ make[2]: *** [third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/build.make:76: third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/glslang_tab.cpp.obj] Error 1 make[1]: *** [CMakeFiles/Makefile2:375: third_party/glslang/glslang/CMakeFiles/MachineIndependent.dir/all] Error 2 make: *** [Makefile:136: all] Error 2
MSYS2 already has
glslang
packaged, what about just using it?
I have upgrade glslang to version 12.2.0, looks like they have fix the stdint issue: https://github.com/KhronosGroup/glslang/commit/1e4955adbcd9b3f5eaf2129e918ca057baed6520 try build on MSYS2 again to see if it works
The Ninja generator still not work (will always give the error I posted on the beginning of this thread). I still have to use the MSYS Makefiles generator with cmake -G "MSYS Makefiles" ..
.
The latest build error is:
[ 82%] Linking CXX static library ../lib/libassimp.a
[ 82%] Built target assimp
[ 82%] Built target SPIRV
make[2]: *** No rule to make target 'third_party/glslang/glslang/libGenericCodeGen.a', needed by 'C:/msys64/home/Administrator/SoftGLRender/bin/SoftGLRender.exe'. Stop.
make[1]: *** [CMakeFiles/Makefile2:269: CMakeFiles/SoftGLRender.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I found the issue. It needs CMAKE_BUILD_TYPE
to be specified. Setting CMAKE_BUILD_TYPE
then the Ninja generator will also work.
On MSYS2 MINGW64, the default generator for CMake is Ninja.
CMake configuration is fine:
But when building with Ninja it failed: