smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
615 stars 156 forks source link

Version 17.1.460 broken for MinGW-w64 #139

Closed brechtsanders closed 1 year ago

brechtsanders commented 1 year ago

When building version 17.1.460 with MinGW-w64 there are several errors like this:

FAILED: src_cpp/CMakeFiles/screen_capture_lite_static.dir/ScreenCapture.cpp.obj
D:\Prog\winlibs64-11.3.0msvcrt\mingw64\bin\c++.exe -DNOMINMAX -IR:/winlibs64-11.3.0msvcrt/screen_capture_lite-17.1.460/src_cpp/../include -IR:/winlibs64-11.3.0msvcrt/screen_capture_lite-17.1.460/src_cpp/../include/windows -O3 -DNDEBUG -std=c++20 -MD -MT src_cpp/CMakeFiles/screen_capture_lite_static.dir/ScreenCapture.cpp.obj -MF src_cpp\CMakeFiles\screen_capture_lite_static.dir\ScreenCapture.cpp.obj.d -o src_cpp/CMakeFiles/screen_capture_lite_static.dir/ScreenCapture.cpp.obj -c R:/winlibs64-11.3.0msvcrt/screen_capture_lite-17.1.460/src_cpp/ScreenCapture.cpp
In file included from d:\prog\winlibs64-11.3.0msvcrt\mingw64\include\c++\11.3.0\stop_token:34,
                 from d:\prog\winlibs64-11.3.0msvcrt\mingw64\include\c++\11.3.0\thread:40,
                 from r:\winlibs64-11.3.0msvcrt\screen_capture_lite-17.1.460\include\screencapture.h:23,
                 from R:/winlibs64-11.3.0msvcrt/screen_capture_lite-17.1.460/src_cpp/ScreenCapture.cpp:1:
d:\prog\winlibs64-11.3.0msvcrt\mingw64\include\c++\11.3.0\atomic: In instantiation of 'struct std::atomic<std::shared_ptr<SL::Screen_Capture::Timer> >':
r:\winlibs64-11.3.0msvcrt\screen_capture_lite-17.1.460\include\internal\sccommon.h:11:46:   required from here
d:\prog\winlibs64-11.3.0msvcrt\mingw64\include\c++\11.3.0\atomic:211:21: error:
static assertion failed: std::atomic requires a trivially copyable type
  211 |       static_assert(__is_trivially_copyable(_Tp),
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\prog\winlibs64-11.3.0msvcrt\mingw64\include\c++\11.3.0\atomic:211:21: note: 'false' evaluates to false

which are solved by changing

#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L

to

#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)

in the following files:

smasherprog commented 1 year ago

Create a quick PR on this! nice find!

smasherprog commented 1 year ago

were you able to do a PR on this?

brechtsanders commented 1 year ago

I won't be able to before the weekend, sorry

smasherprog commented 1 year ago

PR is merged hope this fixes it. Thanks for the PR!

smasherprog commented 1 year ago

gonna close this now since i think the issue should be fixed