[odb-users] ODB 2.5.0-b.27 - MSVC 2019 - C++17 /permissive- flag error

Boris Kolpackov boris at codesynthesis.com
Mon Aug 26 07:48:44 EDT 2024


Lloyd <lloydkl.tech at gmail.com> writes:

> 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-".

Hm, I don't believe /permissive- is required by Qt. We build it without
this flag without any problems.


> 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'
> ...
>
> 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?

In our experience (admittedly from a few years ago, but then you
don't specify the version of MSVC either), the /permissive- flag
broke a lot of perfectly valid code due to the MSVC compiler bugs.

But if you can provide the complete diagnostics that you are getting
(including file names and locations), I can take a look to at least
get a sense if it's something real or not.



More information about the odb-users mailing list