msys2 build for windows not work with error of third-parth
i want to build for windows application. pacman -S git cmake make mingw-w64-x86_64-dlfcn mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 git clone https://github.com/ggerganov/ggwave --recursive cd ggwave && mkdir build && cd build cmake .. errors are as follows:
Administrator@PC-20210921XFIO MSYS /f/cexindao/audio/ggwave/build $ cmake .. CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument
-- The C compiler identification is GNU 14.2.0 -- The CXX compiler identification is GNU 14.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /d/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: /d/msys64/mingw64/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Git: /usr/bin/git.exe (found version "2.46.1") -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- SDL2_INCLUDE_DIRS = /d/msys64/mingw64/include;/d/msys64/mingw64/include/SDL2 -- SDL2_LIBRARIES = SDL2::SDL2main;SDL2::SDL2 CMake Deprecation Warning at examples/third-party/ggsock/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument
-- Configuring done (5.9s) -- Generating done (1.8s) -- Build files have been written to: /f/cexindao/audio/ggwave/build
Administrator@PC-20210921XFIO MSYS /f/cexindao/audio/ggwave/build
$ make
[ 2%] Building CXX object src/CMakeFiles/ggwave.dir/ggwave.cpp.o
F:/cexindao/audio/ggwave/src/ggwave.cpp:48:6: warning: 'void ggwave_setLogFile(void*
)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
48 | void ggwave_setLogFile(void * fptr) {
| ^~~~~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:53:19: warning: 'ggwave_Parameters ggwave_ge
tDefaultParameters()' redeclared without dllimport attribute: previous dllimport ign
ored [-Wattributes]
53 | ggwave_Parameters ggwave_getDefaultParameters(void) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:58:17: warning: 'ggwave_Instance ggwave_ini
(ggwave_Parameters)' redeclared without dllimport attribute: previous dllimport igno
red [-Wattributes]
58 | ggwave_Instance ggwave_init(ggwave_Parameters parameters) {
| ^~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:82:6: warning: 'void ggwave_free(ggwave_Inst
ance)' redeclared without dllimport attribute: previous dllimport ignored [-Wattribu
tes]
82 | void ggwave_free(ggwave_Instance id) {
| ^~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:94:5: warning: 'int ggwave_encode(ggwave_Ins
tance, const void*, int, ggwave_ProtocolId, int, void*, int)' redeclared without dll
import attribute: previous dllimport ignored [-Wattributes]
94 | int ggwave_encode(
| ^~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:138:5: warning: 'int ggwave_decode(ggwave_In
stance, const void*, int, void*)' redeclared without dllimport attribute: previous d
llimport ignored [-Wattributes]
138 | int ggwave_decode(
| ^~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:164:5: warning: 'int ggwave_ndecode(ggwave_I
nstance, const void*, int, void*, int)' redeclared without dllimport attribute: prev
ious dllimport ignored [-Wattributes]
164 | int ggwave_ndecode(
| ^~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:194:6: warning: 'void ggwave_rxToggleProtoco
l(ggwave_ProtocolId, int)' redeclared without dllimport attribute: previous dllimpor
t ignored [-Wattributes]
194 | void ggwave_rxToggleProtocol(
| ^~~~~~~~~~~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:201:6: warning: 'void ggwave_txToggleProtoco
l(ggwave_ProtocolId, int)' redeclared without dllimport attribute: previous dllimpor
t ignored [-Wattributes]
201 | void ggwave_txToggleProtocol(
| ^~~~~~~~~~~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:208:6: warning: 'void ggwave_rxProtocolSetFr
eqStart(ggwave_ProtocolId, int)' redeclared without dllimport attribute: previous dl
limport ignored [-Wattributes]
208 | void ggwave_rxProtocolSetFreqStart(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:215:6: warning: 'void ggwave_txProtocolSetFr
eqStart(ggwave_ProtocolId, int)' redeclared without dllimport attribute: previous dl
limport ignored [-Wattributes]
215 | void ggwave_txProtocolSetFreqStart(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F:/cexindao/audio/ggwave/src/ggwave.cpp:222:5: warning: 'int ggwave_rxDurationFrame
(ggwave_Instance)' redeclared without dllimport attribute: previous dllimport ignore
d [-Wattributes]
222 | int ggwave_rxDurationFrames(ggwave_Instance id) {
| ^~~~~~~~~~~~~~~~~~~~~~~
[ 4%] Linking CXX shared library ../bin/msys-ggwave.dll
[ 4%] Built target ggwave
[ 6%] Building C object tests/CMakeFiles/test-ggwave-c.dir/test-ggwave.c.o
[ 8%] Linking C executable ../bin/test-ggwave-c.exe
[ 8%] Built target test-ggwave-c
[ 11%] Building CXX object tests/CMakeFiles/test-ggwave-cpp.dir/test-ggwave.cpp.o
[ 13%] Linking CXX executable ../bin/test-ggwave-cpp.exe
[ 13%] Built target test-ggwave-cpp
[ 15%] Building CXX object examples/CMakeFiles/ggwave-common.dir/ggwave-common.cpp.o
F:/cexindao/audio/ggwave/examples/ggwave-common.cpp:13:6: warning: 'void {anonymous}
::dummy()' defined but not used [-Wunused-function]
13 | void dummy() {}
| ^~~~~
[ 17%] Linking CXX shared library ../bin/msys-ggwave-common.dll
[ 17%] Built target ggwave-common
[ 20%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui.dir/imgui/imgui.cpp.o
F:/cexindao/audio/ggwave/examples/third-party/imgui/imgui/imgui.cpp: In member funct
ion 'void ImGuiStackSizes::CompareWithCurrentState()':
F:/cexindao/audio/ggwave/examples/third-party/imgui/imgui/imgui.cpp:7004:18: warning
: unused variable 'window' [-Wunused-variable]
7004 | ImGuiWindow* window = g.CurrentWindow;
| ^~~~~~
[ 22%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui.dir/imgui/imgui_draw.cpp.o
[ 24%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui.dir/imgui/imgui_demo.cpp.o
[ 26%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui.dir/imgui/imgui_widgets.cpp.o
[ 28%] Linking CXX shared library ../../../bin/msys-imgui.dll
[ 28%] Built target imgui
[ 31%] Building C object examples/third-party/imgui/CMakeFiles/imgui-sdl2.dir/imgui/examples/libs/gl3w/GL/gl3w.c.o
[ 33%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui-sdl2.dir/imgui-extra/imgui_impl.cpp.o
[ 35%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui-sdl2.dir/imgui-extra/imgui_impl_sdl.cpp.o
[ 37%] Building CXX object examples/third-party/imgui/CMakeFiles/imgui-sdl2.dir/imgui-extra/imgui_impl_opengl3.cpp.o
[ 40%] Linking CXX shared library ../../../bin/msys-imgui-sdl2.dll
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: CMakeFiles/imgui-sdl2.dir/imgui/examples/libs/gl3w/GL/gl3w.c.o:gl3
w.c:(.text+0xa): undefined reference to __imp_wglGetProcAddress' D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mi ngw32/bin/ld.exe: CMakeFiles/imgui-sdl2.dir/imgui/examples/libs/gl3w/GL/gl3w.c.o:gl3 w.c:(.text+0x1382): undefined reference to __imp_wglGetProcAddress'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: CMakeFiles/imgui-sdl2.dir/imgui/examples/libs/gl3w/GL/gl3w.c.o:gl3
w.c:(.text+0x5a5a): undefined reference to `__imp_wglGetProcAddress'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [examples/third-party/imgui/CMakeFiles/imgui-sdl2.dir/build.make:148: bin/msys-imgui-sdl2.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:617: examples/third-party/imgui/CMakeFiles/imgui-sdl2.dir/all] Error 2
make: *** [Makefile:146: all] Error 2