如何避免这些错误? [英] How to avoid these errors?
问题描述
错误C1083无法打开预编译的头文件:'.\Debug \D25.pch':没有这样的文件或目录
我有什么试过:
错误LNK2019未解析的外部符号__declspec(dllimport)public:static struct CRuntimeClass * __stdcall cD25Dlg :: GetThisClass(void)(__ imp_? GetThisClass @ cD25Dlg @@ SGPAUCRuntimeClass @@ XZ)函数protected:long __thiscall cSettings297Frame :: OnRequestShowTab(unsigned int,long)(?OnRequestShowTab @ cSettings297Frame @@ IAEJIJ @ Z)
Error C1083 Cannot open precompiled header file: '.\Debug\D25.pch': No such file or directory
What I have tried:
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: static struct CRuntimeClass * __stdcall cD25Dlg::GetThisClass(void)" (__imp_?GetThisClass@cD25Dlg@@SGPAUCRuntimeClass@@XZ) referenced in function "protected: long __thiscall cSettings297Frame::OnRequestShowTab(unsigned int,long)" (?OnRequestShowTab@cSettings297Frame@@IAEJIJ@Z)
推荐答案
右键单击解决方案资源管理器中的项目。
导航到>属性>所有配置。
打开C / C ++树,然后打开>预编译标题。选择使用{/ Yu}
填写页眉文件字段 - 您的默认值应为pch.h
确保您的头文件包含pch.h并且#include已正确编辑
验证项目中是否有pch.cpp文件。如果不存在则创建。只应在顶部包含#include pch.h
查看此属性> AllConfigs。选择PreCompiled Header Create {/ Yc}。这将只绑定到pch.cpp
验证#include pch.h是所有源文件的第一行。
Right click on the project in solution explorer.
Navigate to >Properties >All Configurations.
Open the tree for C/C++ and then >Precompiled Headers. Select Use {/Yu}
Fill in the Header File field- yours should default to something like pch.h
Make sure your header files contain pch.h and that your #include is edited correctly
Verify you have a pch.cpp file in project. Create if not present. Should only contain #include pch.h at the top
View Properties >AllConfigs on this file. Select PreCompiled Header Create {/Yc}. This will bind to only pch.cpp
Verify that #include pch.h is the first line of all source files.
第一个错误表示您需要(重新)创建预编译的标头。请参阅项目设置中的编译器部分。
第二个错误表明链接器找不到cD25Dlg :: GetThisClass $的定义C $ C>。可能是因为第一个错误,可能是因为一个源模块没有编译。
The first error indicates that you need to (re-)create your pre-compiled headers. See the Compiler section in the Project settings.
The second error indicates that the linker cannot find the definition ofcD25Dlg::GetThisClass
. Possibly because of the first error, possibly because one source module did not compile.
这篇关于如何避免这些错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!