Failed to build on MSYS2 MINGW64
$ ninja -j1
[1/217] Building CXX object CMakeFiles/ssGUI.dir/Src/ssGUI/ssGUIManager.cpp.obj
[2/217] Building CXX object CMakeFiles/ssGUI.dir/Src/ssGUI/Factory.cpp.obj
[3/217] Building C object CMakeFiles/ssGUI.dir/Src/ssGUI/EmbeddedResources.c.obj
FAILED: CMakeFiles/ssGUI.dir/Src/ssGUI/EmbeddedResources.c.obj
C:\msys64\mingw64\bin\cc.exe -DSSGUI_FONT_BACKEND_FREE_TYPE -DSSGUI_IMAGE_BACKEND_STB_IMAGE -DSSGUI_MAIN_BACKEND_WIN32_OPENGL -DssGUI_LOG_LEVEL=2 -DssLOG_CALL_STACK=0 -DssLOG_LOG_TO_FILE=0 -DssLOG_SHOW_FILE_NAME=1 -DssLOG_SHOW_FUNC_NAME=1 -DssLOG_SHOW_LINE_NUM=1 -DssLOG_SHOW_TIME=1 -DssLOG_THREAD_SAFE=0 -DssLOG_USE_SOURCE -IC:/msys64/home/Administrator/ssGUI/Include -IC:/msys64/home/Administrator/ssGUI/External/glm -IC:/msys64/home/Administrator/ssGUI -IC:/msys64/home/Administrator/ssGUI/External/wglExt -IC:/msys64/home/Administrator/ssGUI/External/clip -IC:/msys64/home/Administrator/ssGUI/External/ssLogger/include -IC:/msys64/home/Administrator/ssGUI/External/ssTest/Include -IC:/msys64/home/Administrator/ssGUI/External/glad_v0.1.36/include -IC:/msys64/home/Administrator/ssGUI/build/freetype/include -IC:/msys64/home/Administrator/ssGUI/External/freetype/include -IC:/msys64/home/Administrator/ssGUI/External/stb_image -Wall -Wno-return-local-addr -Wno-sign-compare -Wno-unused-variable -Wno-unused-parameter -Wno-switch -Wextra -pedantic -Werror -MD -MT CMakeFiles/ssGUI.dir/Src/ssGUI/EmbeddedResources.c.obj -MF CMakeFiles\ssGUI.dir\Src\ssGUI\EmbeddedResources.c.obj.d -o CMakeFiles/ssGUI.dir/Src/ssGUI/EmbeddedResources.c.obj -c C:/msys64/home/Administrator/ssGUI/Src/ssGUI/EmbeddedResources.c
C:/msys64/home/Administrator/ssGUI/Src/ssGUI/EmbeddedResources.c:2: error: ISO C forbids an empty translation unit [-Werror=pedantic]
cc1.exe: all warnings being treated as errors
ninja: build stopped: subcommand failed.
Which branch are you building from?
The default branch (didn't specify any specific branch): git clone --recursive https://github.com/Neko-Box-Coder/ssGUI
Did you use CMake to generate the ninja make files?
If so when you were doing cmake (cmake ..), it should give a warning with something like
Embed2C not found, please run "cmake --build . --target Embed2C" in the build folder
Can I confirm if the warning had come up?
In order to build master, you need to:
- build the Embed2C target
- Run
cmake ..again in order to populate the embedded resources - build ssGUI normally.
I haven't tested building it in MSYS2/MINGW so I don't know if it will build successfully or not, it should but I am not sure.
Alternatively, you can use the v0.94.00.a_release branch if you want (A bit outdated compare to master) which has all the embedded resources already populated
This is cmake configuration output:
$ cmake ..
-- Building for: Ninja
-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: C:/msys64/mingw64/bin/pkg-config.exe (found version "1.8.0")
-- Found the following HarfBuzz libraries:
-- HarfBuzz (required): C:/msys64/mingw64/lib/libharfbuzz.dll.a
-- Found HarfBuzz: C:/msys64/mingw64/include/harfbuzz (found suitable version "7.3.0", minimum required is "2.0.0")
-- Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version "1.2.13")
-- Found PNG: C:/msys64/mingw64/lib/libpng.dll.a (found version "1.6.39")
-- Found BZip2: C:/msys64/mingw64/lib/libbz2.dll.a (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Checking for module 'bzip2'
-- Found bzip2, version 1.0.6
-- Found BrotliDec: C:/msys64/mingw64/include (found version "1.0.9")
-- Found OpenGL: opengl32
CMake Warning at External/Embed2C/embedFile.cmake:20 (message):
Embed2C not found, please run "cmake --build . --target Embed2C" in the
build folder
Call Stack (most recent call first):
External/Embed2C/embedFile.cmake:35 (GET_EXEC_PATH)
CMakeLists.txt:413 (EMBED_FILES)
CMake Warning at External/Embed2C/embedFile.cmake:40 (message):
Failed to run embed2C
Call Stack (most recent call first):
CMakeLists.txt:413 (EMBED_FILES)
CMake Warning at CMakeLists.txt:425 (message):
Failed to embed default resources
CMake Warning at External/Embed2C/embedFile.cmake:20 (message):
Embed2C not found, please run "cmake --build . --target Embed2C" in the
build folder
Call Stack (most recent call first):
External/Embed2C/embedFile.cmake:35 (GET_EXEC_PATH)
CMakeLists.txt:483 (EMBED_FILES)
CMake Warning at External/Embed2C/embedFile.cmake:40 (message):
Failed to run embed2C
Call Stack (most recent call first):
CMakeLists.txt:483 (EMBED_FILES)
CMake Warning at CMakeLists.txt:495 (message):
Failed to embed test resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
Linking: ssGUI
Linking: ssGUI_Test_Resources
CMake Warning at External/Embed2C/embedFile.cmake:20 (message):
Embed2C not found, please run "cmake --build . --target Embed2C" in the
build folder
Call Stack (most recent call first):
External/Embed2C/embedFile.cmake:35 (GET_EXEC_PATH)
CMakeLists.txt:559 (EMBED_FILES)
CMake Warning at External/Embed2C/embedFile.cmake:40 (message):
Failed to run embed2C
Call Stack (most recent call first):
CMakeLists.txt:559 (EMBED_FILES)
CMake Warning at CMakeLists.txt:567 (message):
Failed to embed example resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
Linking: ssGUI
Linking: ssGUI_Example_Resources
-- Configuring done (3.4s)
-- Generating done (0.2s)
-- Build files have been written to: C:/msys64/home/Administrator/ssGUI/build
Cool, it did show the warning.
Yeah just do cmake --build . --target Embed2C in your build directory and rerun cmake .. again
CMake Warning at External/Embed2C/embedFile.cmake:20 (message):
Embed2C not found, please run "cmake --build . --target Embed2C" in the
build folder
Shouldn't show up after you built Embed2C