# Compiling with C++17 in VS2017

**URL:** <https://discourse.libcinder.org/t/compiling-with-c-17-in-vs2017/1498>\
**Category:** Developing Cinder\
**Created:** [May 7, 2019, 11:54am UTC](https://discourse.libcinder.org/t/compiling-with-c-17-in-vs2017/1498 "2019-05-07T11:54:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![totalgee](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/totalgee/32/274_2.png) [@totalgee](https://discourse.libcinder.org/u/totalgee)\
**Post date:** [May 7, 2019, 11:54am UTC](https://discourse.libcinder.org/t/compiling-with-c-17-in-vs2017/1498/1 "2019-05-07T11:54:59Z")

</div>

I can build Cinder 0.9.1 (and projects using it) with VS2017 and the v141 toolset. However, there is a further issue… Has anyone tried to use VS2017 in **C++17** mode (using the `/std:c++17` or `/std:c++latest` flags)? In C++17, some standard library features have been _removed_ (not just deprecated!), and so Cinder’s existing Boost (1.60) version won’t work. For example, Boost uses `std::binary_function` in [`boost/utility/compare_pointees.hpp`](https://github.com/cinder/Cinder-Boost/blob/36094d7ed13fa93b34c39f1a065e78798bf27691/utility/compare_pointees.hpp), and this template was [removed in C++17](https://en.cppreference.com/w/cpp/utility/functional/binary_function). (Same goes for `std::unary_function`). I notice that even in the latest version of Cinder on GitHub, Boost 1.60 is still in use. Are there plans to update Cinder to a more recent version of Boost?

Thanks,  
Glen.

---

<div class="post-metadata">

**Author:** ![rich.e](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/rich.e/32/1025_2.png) [@rich.e](https://discourse.libcinder.org/u/rich.e)\
**Post date:** [May 7, 2019, 7:57pm UTC](https://discourse.libcinder.org/t/compiling-with-c-17-in-vs2017/1498/2 "2019-05-07T19:57:11Z")

</div>

I think the move is towards not shipping with boost at all for newer compiler toolsets, and only keep boost headers / binaries for the toolsets that we still need to support and don’t yet have `<filesystem>` or `<system>`. We’ve been working to reduce our dependencies and we’re just about there, `ci::JsonTree` being pretty much the only thing left (btw, I just opened [an issue](https://github.com/cinder/Cinder/issues/2092) about its future removal).

I think if you wanted to go and update the boost submodule to latest on your end you could without issues, you wouldn’t need to link to boost libraries on windows with toolset v140 or higher siice they aren’t used.

---

<div class="post-metadata">

**Author:** ![totalgee](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/totalgee/32/274_2.png) [@totalgee](https://discourse.libcinder.org/u/totalgee)\
**Post date:** [May 8, 2019, 8:55am UTC](https://discourse.libcinder.org/t/compiling-with-c-17-in-vs2017/1498/3 "2019-05-08T08:55:16Z")

</div>

Thanks, I’ll give that a try. The issue is I’m also using some other Boost functionality in my own apps (including some compiled libraries). It might work, though – the good thing is that some of my own Boost dependencies can be replaced by `std` functionality in C++17 (e.g. `boost::optional` and `variant` can be replaced by `std::optional` and `variant`).

I think I tried on an earlier occasion (a year or more ago) to swap in a newer version of Boost and ran into a mess of problems, but I’ll give it another try if you think there are in fact few Cinder dependencies on it (BTW is your statement true even in 0.9.1, or just `current`?).

Thanks!
