# Enabling C++ 17/20 for a plugin

**URL:** https://discourse.paraview.org/t/enabling-c-17-20-for-a-plugin/6498
**Category:** Development
**Created:** [February 18, 2021, 1:13pm UTC](https://discourse.paraview.org/t/enabling-c-17-20-for-a-plugin/6498 "2021-02-18T13:13:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PetiteViking](https://discourse.paraview.org/user_avatar/discourse.paraview.org/petiteviking/32/4074_2.png) [@PetiteViking](https://discourse.paraview.org/u/PetiteViking)
#### Post date: [February 18, 2021, 1:13pm UTC](https://discourse.paraview.org/t/enabling-c-17-20-for-a-plugin/6498/1 "2021-02-18T13:13:16Z")

</div>

Hi,  
does anyone have experience with setting a more modern C++ standard for their plugin to compile with ParaView?

I added `set_property(TARGET MyTarget PROPERTY CXX_STANDARD 17)` to the CMakeLists.txt and in Visual Studio, the project shows up as using C++ 17 (see below) but I somehow still get errors saying that `optional`, `nullopt`, etc are not members of `std`.

Any ideas?

---

<div class="post-metadata">

### Author: ![Thomas\_Caissard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/thomas_caissard/32/5950_2.png) [@Thomas\_Caissard](https://discourse.paraview.org/u/Thomas_Caissard)
#### Post date: [February 18, 2021, 2:26pm UTC](https://discourse.paraview.org/t/enabling-c-17-20-for-a-plugin/6498/2 "2021-02-18T14:26:05Z")

</div>

Hey!

Could you provide the MSVC version your are using and the compilation log?

---

<div class="post-metadata">

### Author: ![PetiteViking](https://discourse.paraview.org/user_avatar/discourse.paraview.org/petiteviking/32/4074_2.png) [@PetiteViking](https://discourse.paraview.org/u/PetiteViking)
#### Post date: [February 18, 2021, 2:56pm UTC](https://discourse.paraview.org/t/enabling-c-17-20-for-a-plugin/6498/3 "2021-02-18T14:56:58Z")

</div>

For anyone wondering, the solution is to also set the standard for the auto-generated project `vtkMyTargetCS`, ie

```auto
set_property(
  TARGET
    MyTarget
    vtkMyTargetCS
  PROPERTY
    CXX_STANDARD 17
)

```

You may close the issue.

---

<div class="post-metadata">

### Author: ![Thomas\_Caissard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/thomas_caissard/32/5950_2.png) [@Thomas\_Caissard](https://discourse.paraview.org/u/Thomas_Caissard)
#### Post date: [February 18, 2021, 3:21pm UTC](https://discourse.paraview.org/t/enabling-c-17-20-for-a-plugin/6498/4 "2021-02-18T15:21:26Z")

</div>

Good to know! Thanks for sharing the information with us.
