-1

I'm building an openFrameworks project (using the project generator which generates VS2017 solutions) but am receiving the "build tools for v142 cannot be found" error. Answers across Stack Overflow say to go into Project > Properties > Configuration Properties > General and set Platform Toolset to v141 in order to downgrade, however my project fails to build with the same error even after doing this. See this screenshot for details:

screenshot of error

Here's what I installed from the installer:

screenshot of installer

I do have VS 2019 installed as well, and I cannot uninstall it.

How can I resolve this error and build on VS 2017?

A__
  • 1,616
  • 2
  • 19
  • 33
  • 3
    The error references one project, but the Property Pages refer to another. – dxiv Jan 07 '21 at 00:10
  • 1
    @dxiv Yesss good catch! I didn't realize I have to individually downgrade every project in my solution. – A__ Jan 07 '21 at 00:19
  • Does Visual Studio 2017 support the toolset from 2019?? – drescherjm Jan 07 '21 at 00:20
  • @drescherjm If v142 is the 2019 toolset, then no, the "v142 cannot be found" error will occur. Why openframeworksLib is automatically set to v142 toolset is beyond me. I believe the latest openFrameworks build is meant for vs2017. – A__ Jan 07 '21 at 00:24
  • 1
    v140 = VS2015, v141 = VS2017, v142 = VS2019. I think your problem is similar to this: [https://stackoverflow.com/questions/44046355/visual-studio-2015-not-detecting-v141-2017-build-tools](https://stackoverflow.com/questions/44046355/visual-studio-2015-not-detecting-v141-2017-build-tools) – drescherjm Jan 07 '21 at 00:26
  • Yes that question is asking how to use a later platform's toolset whereas here I'm asking how to downgrade the toolset specifically, but @malloc's answer there is the solution here. – A__ Jan 07 '21 at 00:38
  • I can be wrong however I feel that the reason you are in this situation is that openFrameworks generated a visual studio 2019 project. However as long as it works I think you will be fine. – drescherjm Jan 07 '21 at 00:51
  • 1
    Yeah, it must have right? It's just weird because if you look at https://openframeworks.cc/download/ you can see the only VS option available is 2017... the project generator is bundled with this download package there... perhaps I'm missing something – A__ Jan 07 '21 at 00:55
  • I see what you say. I am not sure. – drescherjm Jan 07 '21 at 02:39

1 Answers1

2

As @dxiv mentioned in the comments: "The error references one project, but the Property Pages refer to another." Every project in the solution (there should be two for OF projects, yourProjectName and openframeworksLib) needs to be individually downgraded. Instead of going to Project > Properties via the top toolbar, right click on each project in the Solution Explorer and get to the Properties menu for each of them from there.

screenshot

And I just realized the top toolbar's Project menu item coincides with whatever item you currently have selected from the Solution explorer.

A__
  • 1,616
  • 2
  • 19
  • 33