Open brechtsanders opened 1 year ago
This happens for me as well in a project that uses absl, but disabling building shared libs did not help.
Forcing a specific implementation of abseil waiter with cxxflag -DABSL_FORCE_WAITER_MODE=4
(4 for stdcpp) seems to be a work-around for the build errors related to Waiter
. I found this option in waiter.h.
For me adding -DABSL_FORCE_WAITER_MODE=4
(4 = ABSL_WAITER_MODE_STDCPP
) to CMake flag CMAKE_CXX_FLAGS
also fixes the build.
But I think it would be cleaner to actually fix the native method (3 = ABSL_WAITER_MODE_WIN32
).
I tried this on Linux using mingw32 as a cross compiler and saw what @flxzt mentioned. I think it is a different issue from @brechtsanders original report.
As far as I can tell, the native implementation requires at least Windows Vista. When I tried mingw32 as a cross compiler, it seems to by default target an earlier version of Windows, which is why the build fails. Maybe there is some flag to specify the minimum Windows version to target? At head we now fallback to StdcppWaiter
, which fixes this issue.
The original report from @brechtsanders seems to be trying to use the native implementation. I haven't tried to figure out why it is failing yet, but it does appear to fail in a different way.
Describe the issue
Building Abseil 20230802.0 with MinGW-w64 fails when building with
-DBUILD_SHARED_LIBS:BOOL=ON
Steps to reproduce the problem
What version of Abseil are you using?
20230802.0
What operating system and version are you using?
Windows 11
What compiler and version are you using?
Tried with GCC 12.2.0 and 13.1.0
What build system are you using?
CMake 3.27.1 + Ninja 1.11.1
Additional context
Builds fine with
-DBUILD_SHARED_LIBS:BOOL=OFF