[odb-users] ODB 2.5.0-b.27 - MSVC 2019 - C++17 /permissive- flag
error
Lloyd
lloydkl.tech at gmail.com
Fri Aug 23 02:51:26 EDT 2024
Hi,
I am trying out a minimal Qt 6.7 application which is making use of ODB
2.5. Qt 6.7 requires C++17 as the minimum. On Windows, along with C++17 it
also needs to set MSVC compiler flags "/Zc:__cplusplus" and
"/permissive-". When I pass "/permissive-" to the compiler, I am seeing a
lot of compiler errors similar to
error C2955: 'odb::query': use of class template requires template argument
list
...
error C2039: 'User': is not a member of 'odb::query'
...
etc...
These errors are not related to Qt. If I write a minimal ODB
application with the compiler flag "/permissive-" passed, this error can
be reproduced. If the "/permissive-" option is removed, there are no
compiler errors. May I know how to fix this?
PS: I am using CMake, so the compiler specific settings are passed as:
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/permissive-)
https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170
Thanks a lot in advance
More information about the odb-users
mailing list