F B
F B

Reputation: 39

Qt with visual studio , Qt requires a c++17 compiler

I'm stuck on this, when i compile a project in Visual Studio i have this error at the ouput, telling that:

on nmvc you must the /Zc:__cplusplus option to the compiler (compiling source file QtdesignerWidget.cpp)

I tried the solution to add /Zc:__cplusplus in the project properties -C++ / Command line / Additional options withou success And when i try to make a .pro file in QT VS tools it makes this error:

Warning : Cannot Find any Qt4 projects to export

Upvotes: 3

Views: 4908

Answers (3)

Roman Narizhnyy
Roman Narizhnyy

Reputation: 31

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > C/C++ > Command Line property page.

  3. Add /Zc:__cplusplus or /Zc:__cplusplus- to the Additional options: pane.

The answer is taken from here: https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170

Upvotes: 2

ilmu011
ilmu011

Reputation: 80

Are you sure your language standard is set to C++17 in the project settings?

Go to project properties --> General --> C++ Language Standard

In my case it was default set to C++14. This must be set to C++17.

Upvotes: 0

Watercub3
Watercub3

Reputation: 1

Same problem. Here are my platforms: Qt version: 6.2.0 Qt Visual Studio Tools version: 3.4 Compiler version: VS2019_64

Luckily, I also installed Qt5.14.2 on my computer. When I changed configurations to: Qt5.14.2 and VS2017_64. Problem solved. So I guess VS2019 or Qt VS tools3.4 doesn't work well with Qt6.2.0.

You can have a try.

Upvotes: 0

Related Questions