Failed to build on Windows(mingw64)
Closed this issue · 1 comments
AstroAir commented
Sorry to bother you, I tried to build the latest source code downloaded from GitHub in the mingw64 (msys2) environment, but encountered an error. Below is the compilation error message:
cmake info:
-- Building for: Ninja
-- The CXX compiler identification is GNU 13.2.0
-- 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
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
-- Found libbfd: C:/msys64/mingw64/lib/libbfd.a
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR)
-- Performing Test SUPPORT_WINDOWS_DEBUG_INFO
-- Performing Test SUPPORT_WINDOWS_DEBUG_INFO - Success
-- Found Backward: $<BUILD_INTERFACE:C:/Users/Qrm/Downloads/backward-cpp-master>;$<INSTALL_INTERFACE:include>
-- Configuring done (16.3s)
-- Generating done (0.2s)
-- Build files have been written to: C:/Users/Qrm/Downloads/backward-cpp-master/build
compilation info:
[3/15] Building CXX object CMakeFiles/test_stacktrace.dir/test/stacktrace.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/test/stacktrace.cpp:24:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[4/15] Building CXX object CMakeFiles/test_rectrace.dir/test/rectrace.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/test/rectrace.cpp:24:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[5/15] Building CXX object CMakeFiles/backward.dir/backward.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/backward.cpp:36:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[6/15] Linking CXX executable test_test.exe
FAILED: test_test.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -Wall -Wextra -pedantic-errors -g -Wl,--pdb= CMakeFiles/test_main.dir/test/_test_main.cpp.obj CMakeFiles/test_test.dir/test/test.cpp.obj -o test_test.exe -Wl,--out-implib,libtest_test.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/msys64/mingw64/lib/libbfd.a C:/msys64/mingw64/lib/libdl.dll.a C:/msys64/mingw64/lib/libsframe.a -liberty -lz -ldbghelp -lpsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test_main.dir/test/_test_main.cpp.obj: in function `main':
C:/Users/Qrm/Downloads/backward-cpp-master/test/_test_main.cpp:191:(.text+0x38a): undefined reference to `__imp__set_abort_behavior'
collect2.exe: error: ld returned 1 exit status
[7/15] Linking CXX executable test_stacktrace.exe
FAILED: test_stacktrace.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -Wall -Wextra -pedantic-errors -g -Wl,--pdb= CMakeFiles/test_main.dir/test/_test_main.cpp.obj CMakeFiles/test_stacktrace.dir/test/stacktrace.cpp.obj -o test_stacktrace.exe -Wl,--out-implib,libtest_stacktrace.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/msys64/mingw64/lib/libbfd.a C:/msys64/mingw64/lib/libdl.dll.a C:/msys64/mingw64/lib/libsframe.a -liberty -lz -ldbghelp -lpsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test_main.dir/test/_test_main.cpp.obj: in function `main':
C:/Users/Qrm/Downloads/backward-cpp-master/test/_test_main.cpp:191:(.text+0x38a): undefined reference to `__imp__set_abort_behavior'
collect2.exe: error: ld returned 1 exit status
[8/15] Linking CXX executable test_rectrace.exe
FAILED: test_rectrace.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -Wall -Wextra -pedantic-errors -g -Wl,--pdb= CMakeFiles/test_main.dir/test/_test_main.cpp.obj CMakeFiles/test_rectrace.dir/test/rectrace.cpp.obj -o test_rectrace.exe -Wl,--out-implib,libtest_rectrace.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/msys64/mingw64/lib/libbfd.a C:/msys64/mingw64/lib/libdl.dll.a C:/msys64/mingw64/lib/libsframe.a -liberty -lz -ldbghelp -lpsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test_main.dir/test/_test_main.cpp.obj: in function `main':
C:/Users/Qrm/Downloads/backward-cpp-master/test/_test_main.cpp:191:(.text+0x38a): undefined reference to `__imp__set_abort_behavior'
collect2.exe: error: ld returned 1 exit status
[9/15] Building CXX object CMakeFiles/backward_object.dir/backward.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/backward.cpp:36:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[11/15] Building CXX object CMakeFiles/test_select_signals.dir/test/select_signals.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/test/select_signals.cpp:24:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
bombela commented
set_unexpected was removed in C++2017. I dont know if there is an
alternative, but I guess it should be excluded from compilation from C++17
and onward.
…On Sun, Apr 21, 2024, 04:42 Max Qian ***@***.***> wrote:
Sorry to bother you, I tried to build the latest source code downloaded
from GitHub in the mingw64 (msys2) environment, but encountered an error.
Below is the compilation error message:
cmake info:
-- Building for: Ninja
-- The CXX compiler identification is GNU 13.2.0
-- 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
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
-- Found libbfd: C:/msys64/mingw64/lib/libbfd.a
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR)
-- Performing Test SUPPORT_WINDOWS_DEBUG_INFO
-- Performing Test SUPPORT_WINDOWS_DEBUG_INFO - Success
-- Found Backward: $<BUILD_INTERFACE:C:/Users/Qrm/Downloads/backward-cpp-master>;$<INSTALL_INTERFACE:include>
-- Configuring done (16.3s)
-- Generating done (0.2s)
-- Build files have been written to: C:/Users/Qrm/Downloads/backward-cpp-master/build
compilation info:
[3/15] Building CXX object CMakeFiles/test_stacktrace.dir/test/stacktrace.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/test/stacktrace.cpp:24:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[4/15] Building CXX object CMakeFiles/test_rectrace.dir/test/rectrace.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/test/rectrace.cpp:24:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[5/15] Building CXX object CMakeFiles/backward.dir/backward.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/backward.cpp:36:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[6/15] Linking CXX executable test_test.exe
FAILED: test_test.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -Wall -Wextra -pedantic-errors -g -Wl,--pdb= CMakeFiles/test_main.dir/test/_test_main.cpp.obj CMakeFiles/test_test.dir/test/test.cpp.obj -o test_test.exe -Wl,--out-implib,libtest_test.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/msys64/mingw64/lib/libbfd.a C:/msys64/mingw64/lib/libdl.dll.a C:/msys64/mingw64/lib/libsframe.a -liberty -lz -ldbghelp -lpsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test_main.dir/test/_test_main.cpp.obj: in function `main':
C:/Users/Qrm/Downloads/backward-cpp-master/test/_test_main.cpp:191:(.text+0x38a): undefined reference to `__imp__set_abort_behavior'
collect2.exe: error: ld returned 1 exit status
[7/15] Linking CXX executable test_stacktrace.exe
FAILED: test_stacktrace.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -Wall -Wextra -pedantic-errors -g -Wl,--pdb= CMakeFiles/test_main.dir/test/_test_main.cpp.obj CMakeFiles/test_stacktrace.dir/test/stacktrace.cpp.obj -o test_stacktrace.exe -Wl,--out-implib,libtest_stacktrace.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/msys64/mingw64/lib/libbfd.a C:/msys64/mingw64/lib/libdl.dll.a C:/msys64/mingw64/lib/libsframe.a -liberty -lz -ldbghelp -lpsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test_main.dir/test/_test_main.cpp.obj: in function `main':
C:/Users/Qrm/Downloads/backward-cpp-master/test/_test_main.cpp:191:(.text+0x38a): undefined reference to `__imp__set_abort_behavior'
collect2.exe: error: ld returned 1 exit status
[8/15] Linking CXX executable test_rectrace.exe
FAILED: test_rectrace.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -Wall -Wextra -pedantic-errors -g -Wl,--pdb= CMakeFiles/test_main.dir/test/_test_main.cpp.obj CMakeFiles/test_rectrace.dir/test/rectrace.cpp.obj -o test_rectrace.exe -Wl,--out-implib,libtest_rectrace.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/msys64/mingw64/lib/libbfd.a C:/msys64/mingw64/lib/libdl.dll.a C:/msys64/mingw64/lib/libsframe.a -liberty -lz -ldbghelp -lpsapi -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test_main.dir/test/_test_main.cpp.obj: in function `main':
C:/Users/Qrm/Downloads/backward-cpp-master/test/_test_main.cpp:191:(.text+0x38a): undefined reference to `__imp__set_abort_behavior'
collect2.exe: error: ld returned 1 exit status
[9/15] Building CXX object CMakeFiles/backward_object.dir/backward.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/backward.cpp:36:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
[11/15] Building CXX object CMakeFiles/test_select_signals.dir/test/select_signals.cpp.obj
In file included from C:/Users/Qrm/Downloads/backward-cpp-master/test/select_signals.cpp:24:
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:4343:24: warning: 'void (* std::set_unexpected(unexpected_handler))()' is deprecated [-Wdeprecated-declarations]
4343 | std::set_unexpected(&terminator);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/c++/13.2.0/ios:41,
from C:/msys64/mingw64/include/c++/13.2.0/istream:40,
from C:/msys64/mingw64/include/c++/13.2.0/fstream:40,
from C:/Users/Qrm/Downloads/backward-cpp-master/backward.hpp:84:
C:/msys64/mingw64/include/c++/13.2.0/exception:89:22: note: declared here
89 | unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
| ^~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
—
Reply to this email directly, view it on GitHub
<#335>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUZDGVCWG6CBOXX4NCHQLY6OQ33AVCNFSM6AAAAABGRJ3B32VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TKMBTGMZDQMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>