vc140.pdb being created in undesired location

We have a standard parallel project folder structure for all our projects similar to:

  1. project-source-code/ (For .h/.hpp/.cpp/.cu files)
  2. project-solution-files/ (For .sln/.vcxproj/.vcxproj.filters files)
  3. project-build-data/ (For .obj/.pdb/.ilk/.lib files)

This usually works fine but recently I have noticed that projects involving CUDA are depositing vc140.pdb files in the folder (2) which is NOT OK as it should be in (3). And it has resulted in some people accidentally checking into source control large pdb files by accident etc.

All the standard non-cuda VS2017 settings all point to the right locations and so far I cannot find a specific CUDA build setting to prevent the problem. Is there anyway to fix this?

1 Like

I know this is an old post but you might be interested to know that I filed a bug report about this and it has been acknowledged as a bug and they are working on it.

Having the same issue with VS2019 and CUDA SDK11

Files are stored this way:
project/project.vcxproj
project/src/file.cu
project/obj/Debug/file.obj
project/vc140.pdb
anotherFolder/project.pdb
anotherFolder/project.dll

The vc140.pdb should be generated in obj/Debug instead of the project root folder.
Another issue is that this vc140.pdb is generated at the same location for release and debug builds … causing unnecessary rebuilds when switching build targets.

Regards