Are you trying do a native build or something?
Works fine here, works fine with the github actions stuff, and thread.h indirectly includes windows.h which declares all of these functions. I'm using mingw 9.0 with gcc 11.1 as well.
Actually, can you test if #include <synchapi.h> fixes the problem for you?
I tried adding it to the first cpp that errored and also thread.h
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/54 suggests setting the windows version
This is a mingw64 8 build with gcc 11.1
so does #define _WIN32_WINNT 0x0601 work (either globally or before the windows.h include in com_include.h)?
I don't really understand why this would be broken for you but not for our github actions which are also on mingw 8 afaik.
Setting it inside com_include.h worked but it complained that it was being redefined from /usr/i686-w64-mingw32/usr/include/_mingw.h so changed it there instead (and also /usr/x86_64-w64-mingw32/usr/include/_mingw.h)
can you post your _mingw.h? it does this on my end:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0xa00
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x502
#endif
I notice that mingw64 has a configuration option:
--with-default-win32-winnt=VER
Default value of _WIN32_WINNT (default: 0xa00)
That changed with this commit:
commit f3c53a51df5c08f181e13a39b1cd6fd1d41edb96
Author: Jacek Caban <[email protected]>
Date: Sat Dec 26 14:10:17 2020 +0100
headers: Use Windows 10 as default _WIN32_WINNT value.
Signed-off-by: Jacek Caban <[email protected]>
diff --git a/mingw-w64-headers/configure b/mingw-w64-headers/configure
index c5b5cc84e..7746fafea 100755
--- a/mingw-w64-headers/configure
+++ b/mingw-w64-headers/configure
@@ -1353,7 +1353,7 @@ Optional Packages:
--with-widl=PATH use widl to update idl-based headers. Optionally
search for a compatible widl in PATH
--with-default-win32-winnt=VER
- Default value of _WIN32_WINNT (default: 0x502)
+ Default value of _WIN32_WINNT (default: 0xa00)
I'm wondering if your distro sets --with-default-win32-winnt=0x601 and why you've not seen that in your mingw64-8 builds
Ah, I'm running mingw64 8.0.0
https://github.com/mirror/mingw-w64/commit/f3c53a51df5c08f181e13a39b1cd6fd1d41edb96
Says that version change was added in 8.0.1 - it that by any chance the version your github actions are running?
yeah, probably. Anyway, I guess we can add a workaround for weird builds.
Now the question is, why are you getting warnings about _WIN32_WINNT being redefined when your header has an ifdef guard for it?
Did I add it wrongly?
I'm not sure this is a weird build, it's just 8.0.0, rather than 8.0.1 or 9.0.0
I'll see if the maintainer can get it bumped
no, looks like we're including windows.h from two different places (which is unintended).
Still getting the warning though which is weird.
we can define this in the buildsystem though, that should work.
It it worth defining it in cdata in the mason file? Or does that only work in windows
we can define this in the buildsystem though, that should work.
I'll give it a test on my other machine, if you commit it
See commit above, should hopefully work.
:(
FAILED: src/util/libutil.a.p/util_monitor.cpp.obj
i686-w64-mingw32-g++ -Isrc/util/libutil.a.p -Isrc/util -I../dxvk-9999/src/util -I../dxvk-9999/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -DNOMINMAX -D_WINNT_WIN32=0x0a00 -msse -msse2 -msse3 -mfpmath=sse -O3 -march=native -pipe -flto=8 -MD -MQ src/util/libutil.a.p/util_monitor.cpp.obj -MF src/util/libutil.a.p/util_monitor.cpp.obj.d -o src/util/libutil.a.p/util_monitor.cpp.obj -c ../dxvk-9999/src/util/util_monitor.cpp
In file included from ../dxvk-9999/src/util/./log/log.h:8,
from ../dxvk-9999/src/util/util_monitor.cpp:4:
../dxvk-9999/src/util/./log/../thread.h: In member function ‘void dxvk::mutex::lock()’:
../dxvk-9999/src/util/./log/../thread.h:171:7: error: ‘AcquireSRWLockExclusive’ was not declared in this scope
171 | AcquireSRWLockExclusive(&m_lock);
| ^~~~~~~~~~~~~~~~~~~~~~~
../dxvk-9999/src/util/./log/../thread.h: In member function ‘void dxvk::mutex::unlock()’:
../dxvk-9999/src/util/./log/../thread.h:175:7: error: ‘ReleaseSRWLockExclusive’ was not declared in this scope
175 | ReleaseSRWLockExclusive(&m_lock);
| ^~~~~~~~~~~~~~~~~~~~~~~
../dxvk-9999/src/util/./log/../thread.h: In member function ‘bool dxvk::mutex::try_lock()’:
../dxvk-9999/src/util/./log/../thread.h:179:14: error: ‘TryAcquireSRWLockExclusive’ was not declared in this scope
179 | return TryAcquireSRWLockExclusive(&m_lock);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../dxvk-9999/src/util/./log/../thread.h: In constructor ‘dxvk::condition_variable::condition_variable()’:
../dxvk-9999/src/util/./log/../thread.h:252:7: error: ‘InitializeConditionVariable’ was not declared in this scope
252 | InitializeConditionVariable(&m_cond);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../dxvk-9999/src/util/./log/../thread.h: In member function ‘void dxvk::condition_variable::notify_one()’:
../dxvk-9999/src/util/./log/../thread.h:260:7: error: ‘WakeConditionVariable’ was not declared in this scope; did you mean ‘condition_variable’?
260 | WakeConditionVariable(&m_cond);
| ^~~~~~~~~~~~~~~~~~~~~
| condition_variable
../dxvk-9999/src/util/./log/../thread.h: In member function ‘void dxvk::condition_variable::notify_all()’:
../dxvk-9999/src/util/./log/../thread.h:264:7: error: ‘WakeAllConditionVariable’ was not declared in this scope
264 | WakeAllConditionVariable(&m_cond);
| ^~~~~~~~~~~~~~~~~~~~~~~~
../dxvk-9999/src/util/./log/../thread.h: In member function ‘void dxvk::condition_variable::wait(std::unique_lock<dxvk::mutex>&)’:
../dxvk-9999/src/util/./log/../thread.h:269:7: error: ‘SleepConditionVariableSRW’ was not declared in this scope
269 | SleepConditionVariableSRW(&m_cond, srw, INFINITE, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
did you regenerate your meson build directory? I don't think it does that automatically.
Yes, clean build every time, I also tested with 0xa00 just in case
i'm dumb, typo'd the constant name. Fixed.
Bingo...
That's it all compiling fine on mingw64 8.0.0 without any further alterations
Nothing extracted yet.
I'm seeing the following build failures since the custom sync primitives were added:
This is using gcc-11.1
build.log