Windows MSVC 16.11.9 compile error #265
Comments
The four days ago CI was passed with MSVC 19.29.30138.0. I will deal with this issue when I am near a Windows machine. |
I have tested three cases on a machine with Windows 10 21H2 and Visual Studio 16.11.9 installed, exactly with the MSVC 19.29.30139.0:
There no any issue were in all cases. |
To solve your problem, I can advise:
|
Tried building the generated solution and tried opening CMakeLists.txt - same results. Using Here's my output with --verbose:
|
Building on a fresh install PC worked so must be something wrong with my machine, thanks for the help. |
Oh, think I'm found the cause.
Thus there is definitely impossible to build libmdbx (and any C11 code) with some recent MSVC but old Windows SDK versions. I need to think about how best to workaround this problem. |
I think it's actually newer Windows SDK versions that are causing the issue. I uninstalled all of my SDKs and installed an older one and now I can compile without issues.
//
// stdalign.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// The C Standard Library <stdalign.h> header.
//
#pragma once
#ifndef _INC_STDALIGN // include guard for 3rd party interop
#define _INC_STDALIGN
#include <corecrt.h>
#pragma warning(push)
#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
_UCRT_DISABLE_CLANG_WARNINGS
_CRT_BEGIN_C_HEADER
#if _CRT_HAS_C11
#define alignas _Alignas
#define alignof _Alignof
#define __alignas_is_defined 1
#define __alignof_is_defined 1
#endif // _CRT_HAS_C11
_CRT_END_C_HEADER
_UCRT_RESTORE_CLANG_WARNINGS
#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
#endif // _INC_STDALIGN Then, mdbx has this in a bunch of places: #if __has_include(<stdalign.h>)
#include <stdalign.h>
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define alignas(N) _Alignas(N)
#elif defined(_MSC_VER)
#define alignas(N) __declspec(align(N))
#elif __has_attribute(__aligned__) || defined(__GNUC__)
#define alignas(N) __attribute__((__aligned__(N)))
#else
#error "FIXME: Required _alignas() or equivalent."
#endif So essentially, if I understand the issue correctly, it includes |
You need install some old MSVC too to reproduce noted issue.
As far as I'm understanding for now, a good fix should have the two concepts:
|
@Awpteamoose, could you check the |
Yep, builds and works! |
Awpteamoose commentedJan 31, 2022
The text was updated successfully, but these errors were encountered: