Precompiled headers with DLL solutions. Cannot open precompiled header file

百般思念 提交于 2019-12-03 12:30:57

Are you using "automatically generate", or "use precompiled header" on the project and "create precompiled header" on the one cpp file? The latter is more efficient, but I've seen the per-file configuration on projects get accidentally reset, so that the "stdafx.cpp" (or whatever) file no longer generates the precompiled header.

I had this issue after I deleted and re-added stdafx.cpp from & to my project. Solution:

  • stdafx.cpp needs to have the property Create PrecompiledHeader (/Yc), this sets stdafx.cpp as the one that is responsible for creating the .pch from stdafx.h
  • the project (and with that all the files in it) can have the property Use PrecompiledHeader (/Yu), they can use .pch created by the compilation of stdafx.cpp

Try rebuilding your project in a new, copying only the files needed supplies.

LudoSound.pch was not regenerated. Delete only the folder it was in and build again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!