c++visual-studiovisual-c++visual-studio-express

What are these .pch and .ncb files in visual studio?


I have several small Visual Studio Projects (C++). And many of these projects have .ncb and .pch extension files. Those files are quite big, and they are consuming a lot of space (over 100 mb).

What are these files?

If those files are not that important can I delete them? Can I stop them from being created?


Solution

  • PCH is the precompiled headers file. It's a temporary that you can safely delete. You can disable its creation through Project Settings > C++ > Precompiled Headers > Don't use precompiled headers and removing the stdafx.cpp file from your project.

    NCB is the database used by IntelliSense to allow you to browse the symbols defined in your project, including the inline hints and auto completion as you type. You can safely delete it. There is an option to disable IntelliSense too.

    However, both features may be useful; therefore you may not want to disable them. If you worry about the size of the backups or sending the projects to some other programmer, then you can just clean the project by removing said files.