Trying to compile

Hi I’m newbie in c++ and using the software Openframeworks and as IDE Visual Studio Community 2022 but when I try to compile I get this problem and I don’t know how to fix it:

Operación Compilar iniciada..
1>------ Operación Compilar iniciada: Proyecto: hola_mundo, configuración: Release x64 ------
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(499,5): warning MSB8003: La propiedad WindowsSDKDir no está definida. No se encuentran algunas herramientas de compilación.
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(499,5): warning MSB8003: La propiedad WindowsSDKDir no está definida. No se encuentran algunas herramientas de compilación.
1>Compilación del proyecto "openframeworksLib.vcxproj" terminada.
1>hola_mundo.cpp
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\yvals.h(17,10): fatal  error C1083: No se puede abrir el archivo incluir: 'crtdbg.h': No such file or directory
1>Compilación del proyecto "hola_mundo.vcxproj" terminada -- ERROR.
========== Compilación: 0 correcto, 1 erróneo, 1 actualizado, 0 omitido ==========
========= Compilar se inició en 11:01 PM y tomó 02,761 segundos ==========

Hola Daniel! bienvenido!
In the left panel of VS, the solution navigator, right clic on your project “hola_mundo” and choose retarget project and press ok. that should fix this error.

1 Like

Hey @DanielToledo - welcome!!

I think what @roymacdonald says should fix it, you might also have to do the same for
the openFrameworks project in the side bar too.

Then it should work as expected.

Hi thank you I could fix it using the main.cpp file.

What do you mean by this?

Hi @theo, I’ve been mostly working on windows recently and you only need to do it with the project not with the openFrameworks lib.

Sometimes, VS will show the following dialog as you open a project.
retargetDialog
you should press OK to it (In my case I only have a single option on those dropdowns…)
And you should be good to go.

I noticed that this dialog shows up only when there is no .vs folder in the projects folder. This one is created when you open the project. Thus, if you update the project with project generator such dialog wont show up. But the in solution explorer, the project will have (Visual Studio 2017) attached to its name. Which look like following.
solutionexplorerretarget

In this case you should right click on the project (the one that reads graphicsExample (Visual Studio 2017) in the previous image) and choose “Retarget projects”, which will show the dialog in the first image to which you should press OK.

1 Like