MainWindow.h exited with code 3

I’m trying to play with the SDK and having troubles getting my RealSense D435 to run.

I have a fresh install of Visual Studio 2020.
I have downloaded both QT 5.14.2 and the RealSense 2.39 SDK and have mapped the ‘include’ folders.

I have upgraded/retargeted to Visual Studio 2022

However, when trying to compile, I get an error

“MSB8066 Custom build for ‘MainWindow.h’ exited with code 3. RealSenseReconstruction C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 245”

I uninstalled 2022 and installed VS 2019, just to try getting aligned to what was out when the samples were written and get the same errors.
Here is my VS 2019 Output.


Build started…
1>------ Build started: Project: RealSenseReconstruction, Configuration: Debug x64 ------
1>Performing MOC on MainWindow.h
1>The system cannot find the path specified.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for ‘MainWindow.h’ exited with code 3.
1>Done building project “RealSenseReconstruction.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any insight would be appreciated.

EDIT: I browsed to the directory and the Microsoft.CppCommon.targets does exist.



have you added an environmental variable QTDIR which points to your Qt directory? See section Sample programs in documentation.

Best regards,

Thanks! I think you’re correct. I did miss that step. Sorry.

Also, I reached out to about a custom application is this email still monitored for that kind of request? I got a message bouncing back saying support is no longer offered by email and only license issues.

I got the email for this kind of request from the FAQ.


we’ve replied to your e-mail, please have a look.

Best regards,