boostorg / mysql

MySQL C++ client based on Boost.Asio
https://www.boost.org/doc/libs/master/libs/mysql
Boost Software License 1.0
258 stars 33 forks source link

MSVC 19.32.31329 build fails if BOOST_ASIO_HAS_CONCEPTS #100

Closed 3n16m4 closed 2 years ago

3n16m4 commented 2 years ago

As mentioned in the title, for some reason MSVC fails to build (any) of the examples provided by the documentation page of Boost.Mysql. GCC 12 and Clang 14 build perfectly fine for me. It did not make a difference if I changed the target C++ standard nor did it make a difference if I chose a different branch (master, develop) or tag number.

To reproduce the issue, I've created a repository with an example and a CMake project to illustrate the problem:

git clone https://github.com/3n16m4/boost.mysql-issue && cd boost.mysql-issue
cmake -B build
cmake --build build

Example output:

PS C:\Users\gin\source\repos\CMakeProject1> cmake -B build
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
-- The C compiler identification is MSVC 19.32.31329.0
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: C:/boost_1_79_0_build/lib/cmake/Boost-1.79.0/BoostConfig.cmake (found suitable version "1.79.0", minimum required is "1.72.0") found components: system
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found OpenSSL: optimized;C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MD.lib;debug;C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MDd.lib (found version "3.0.3")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/gin/source/repos/CMakeProject1/build

PS C:\Users\gin\source\repos\CMakeProject1> cmake --build build
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Users/gin/source/repos/CMakeProject1/CMakeProject1/CMakeLists.txt
  CMakeProject1.cpp
  Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
  - add -D_WIN32_WINNT=0x0601 to the compiler command line; or
  - add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
  Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(185,1): error C224
4: 'boost::mysql::resultset<Stream>::async_read_one': unable to match function definition to an existing declaration [C
:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(180): message : se
e declaration of 'boost::mysql::resultset<Stream>::async_read_one' [C:\Users\gin\source\repos\CMakeProject1\build\CMake
Project1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(185,1): message :
definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(185,1): message :
'auto boost::mysql::resultset<Stream>::async_read_one(boost::mysql::row &,boost::mysql::error_info &,CompletionToken &&
)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(185,1): message :
existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(185,1): message :
'auto boost::mysql::resultset<Stream>::async_read_one(boost::mysql::row &,boost::mysql::error_info &,CompletionToken &&
)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(185,1): message :
'auto boost::mysql::resultset<Stream>::async_read_one(boost::mysql::row &,CompletionToken &&)' [C:\Users\gin\source\rep
os\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(316,1): error C224
4: 'boost::mysql::resultset<Stream>::async_read_many': unable to match function definition to an existing declaration [
C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(311): message : se
e declaration of 'boost::mysql::resultset<Stream>::async_read_many' [C:\Users\gin\source\repos\CMakeProject1\build\CMak
eProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(316,1): message :
definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(316,1): message :
'auto boost::mysql::resultset<Stream>::async_read_many(size_t,boost::mysql::error_info &,CompletionToken &&)' [C:\Users
\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(316,1): message :
existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(316,1): message :
'auto boost::mysql::resultset<Stream>::async_read_many(size_t,boost::mysql::error_info &,CompletionToken &&)' [C:\Users
\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(316,1): message :
'auto boost::mysql::resultset<Stream>::async_read_many(size_t,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProj
ect1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(340,1): error C224
4: 'boost::mysql::resultset<Stream>::async_read_all': unable to match function definition to an existing declaration [C
:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(336): message : se
e declaration of 'boost::mysql::resultset<Stream>::async_read_all' [C:\Users\gin\source\repos\CMakeProject1\build\CMake
Project1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(340,1): message :
definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(340,1): message :
'auto boost::mysql::resultset<Stream>::async_read_all(boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\sou
rce\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(340,1): message :
existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(340,1): message :
'auto boost::mysql::resultset<Stream>::async_read_all(boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\sou
rce\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/resultset.hpp(340,1): message :
'auto boost::mysql::resultset<Stream>::async_read_all(CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\bui
ld\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): e
rror C2244: 'boost::mysql::prepared_statement<Stream>::async_execute': unable to match function definition to an existi
ng declaration [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(142): mes
sage : see declaration of 'boost::mysql::prepared_statement<Stream>::async_execute' [C:\Users\gin\source\repos\CMakePro
ject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_execute(const boost::mysql::execute_params<ValueForwardI
terator> &,boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1
\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_execute(const boost::mysql::execute_params<ValueForwardI
terator> &,boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1
\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_execute(const boost::mysql::execute_params<ValueForwardI
terator> &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_execute(const ValueCollection &,boost::mysql::error_info
 &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(147,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_execute(const ValueCollection &,CompletionToken &&)' [C:
\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(196,1): e
rror C2244: 'boost::mysql::prepared_statement<Stream>::async_close': unable to match function definition to an existing
 declaration [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(192): mes
sage : see declaration of 'boost::mysql::prepared_statement<Stream>::async_close' [C:\Users\gin\source\repos\CMakeProje
ct1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(196,1): m
essage : definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(196,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_close(boost::mysql::error_info &,CompletionToken &&)' [C
:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(196,1): m
essage : existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(196,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_close(boost::mysql::error_info &,CompletionToken &&)' [C
:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/prepared_statement.hpp(196,1): m
essage : 'auto boost::mysql::prepared_statement<Stream>::async_close(CompletionToken &&)' [C:\Users\gin\source\repos\CM
akeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(63,1): error C224
4: 'boost::mysql::connection<Stream>::async_connect': unable to match function definition to an existing declaration [C
:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(57): message : se
e declaration of 'boost::mysql::connection<Stream>::async_connect' [C:\Users\gin\source\repos\CMakeProject1\build\CMake
Project1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(63,1): message :
definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(63,1): message :
'auto boost::mysql::connection<Stream>::async_connect(const EndpointType &,const boost::mysql::connection_params &,boos
t::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.
vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(63,1): message :
existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(63,1): message :
'auto boost::mysql::connection<Stream>::async_connect(const EndpointType &,const boost::mysql::connection_params &,boos
t::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.
vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(63,1): message :
'auto boost::mysql::connection<Stream>::async_connect(const EndpointType &,const boost::mysql::connection_params &,Comp
letionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(106,1): error C22
44: 'boost::mysql::connection<Stream>::async_handshake': unable to match function definition to an existing declaration
 [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(101): message : s
ee declaration of 'boost::mysql::connection<Stream>::async_handshake' [C:\Users\gin\source\repos\CMakeProject1\build\CM
akeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(106,1): message :
 definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(106,1): message :
 'auto boost::mysql::connection<Stream>::async_handshake(const boost::mysql::connection_params &,boost::mysql::error_in
fo &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(106,1): message :
 existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(106,1): message :
 'auto boost::mysql::connection<Stream>::async_handshake(const boost::mysql::connection_params &,boost::mysql::error_in
fo &,CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(106,1): message :
 'auto boost::mysql::connection<Stream>::async_handshake(const boost::mysql::connection_params &,CompletionToken &&)' [
C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(154,1): error C22
44: 'boost::mysql::connection<Stream>::async_query': unable to match function definition to an existing declaration [C:
\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(149): message : s
ee declaration of 'boost::mysql::connection<Stream>::async_query' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeP
roject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(154,1): message :
 definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(154,1): message :
 'auto boost::mysql::connection<Stream>::async_query(boost::string_view,boost::mysql::error_info &,CompletionToken &&)'
 [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(154,1): message :
 existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(154,1): message :
 'auto boost::mysql::connection<Stream>::async_query(boost::string_view,boost::mysql::error_info &,CompletionToken &&)'
 [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(154,1): message :
 'auto boost::mysql::connection<Stream>::async_query(boost::string_view,CompletionToken &&)' [C:\Users\gin\source\repos
\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(201,1): error C22
44: 'boost::mysql::connection<Stream>::async_prepare_statement': unable to match function definition to an existing dec
laration [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(196): message : s
ee declaration of 'boost::mysql::connection<Stream>::async_prepare_statement' [C:\Users\gin\source\repos\CMakeProject1\
build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(201,1): message :
 definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(201,1): message :
 'auto boost::mysql::connection<Stream>::async_prepare_statement(boost::string_view,boost::mysql::error_info &,Completi
onToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(201,1): message :
 existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(201,1): message :
 'auto boost::mysql::connection<Stream>::async_prepare_statement(boost::string_view,boost::mysql::error_info &,Completi
onToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(201,1): message :
 'auto boost::mysql::connection<Stream>::async_prepare_statement(boost::string_view,CompletionToken &&)' [C:\Users\gin\
source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(240,1): error C22
44: 'boost::mysql::connection<Stream>::async_close': unable to match function definition to an existing declaration [C:
\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(236): message : s
ee declaration of 'boost::mysql::connection<Stream>::async_close' [C:\Users\gin\source\repos\CMakeProject1\build\CMakeP
roject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(240,1): message :
 definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(240,1): message :
 'auto boost::mysql::connection<Stream>::async_close(boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\sour
ce\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(240,1): message :
 existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(240,1): message :
 'auto boost::mysql::connection<Stream>::async_close(boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\sour
ce\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(240,1): message :
 'auto boost::mysql::connection<Stream>::async_close(CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\buil
d\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(277,1): error C22
44: 'boost::mysql::connection<Stream>::async_quit': unable to match function definition to an existing declaration [C:\
Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(273): message : s
ee declaration of 'boost::mysql::connection<Stream>::async_quit' [C:\Users\gin\source\repos\CMakeProject1\build\CMakePr
oject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(277,1): message :
 definition [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(277,1): message :
 'auto boost::mysql::connection<Stream>::async_quit(boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\sourc
e\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(277,1): message :
 existing declarations [C:\Users\gin\source\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(277,1): message :
 'auto boost::mysql::connection<Stream>::async_quit(boost::mysql::error_info &,CompletionToken &&)' [C:\Users\gin\sourc
e\repos\CMakeProject1\build\CMakeProject1\CMakeProject1.vcxproj]
C:\Users\gin\source\repos\CMakeProject1\build\_deps\mysql-src\include\boost/mysql/impl/connection.hpp(277,1): message :
 'auto boost::mysql::connection<Stream>::async_quit(CompletionToken &&)' [C:\Users\gin\source\repos\CMakeProject1\build
\CMakeProject1\CMakeProject1.vcxproj]

Expected output:

PS C:\Users\gin\source\repos\CMakeProject1> cmake --build build
[ 50%] Building CXX object CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o
[100%] Linking CXX executable CMakeProject1
[100%] Built target CMakeProject1

Information about my system:

anarthal commented 2 years ago

Thanks for reporting and for providing the repo. As long as I've seen, it seems related to concepts. It only happens in C++20 (if you do the following, it builds regularly):

target_compile_features(CMakeProject1 PRIVATE cxx_std_17)
# ...
if (CMAKE_VERSION VERSION_GREATER 3.12)
  set_property(TARGET CMakeProject1 PROPERTY CXX_STANDARD 17)
endif()

As a workaround until I provide a fix, defining BOOST_ASIO_DISABLE_CONCEPTS does the trick:

target_compile_definitions(CMakeProject1 PRIVATE BOOST_ASIO_DISABLE_CONCEPTS)