# Nvcc fatal : Could not set up the environment for Microsoft Visual Studio

Hi!
I’m trying to build OpenCV with CUDA, but I’m getting the following error:

nvcc fatal : Could not set up the environment for Microsoft Visual Studio using ‘C:/Program Files (x86)/Microsoft Visual Studio/20
19/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/…/…/…/…/…/…/…/VC/Auxiliary/Build/vcvars64.bat’

I’m using CUDA v 10.2, Visual Studio 2019, OpenCV 4.3.0 and Windows x64.
How can I fix this error?

Thanks!

1 Like