Click here to Skip to main content
15,891,859 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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)
Posted
Updated 15-Nov-18 0:44am

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.
 
Share this answer
 
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 of cD25Dlg::GetThisClass. Possibly because of the first error, possibly because one source module did not compile.
 
Share this answer
 
Comments
Member 14052778 15-Nov-18 6:43am    
can you explain how to recreate the pre-compiled headers?
Richard MacCutchan 15-Nov-18 6:48am    
See above solution.
MadMyche 15-Nov-18 10:00am    
Thank you
Richard MacCutchan 15-Nov-18 10:17am    
I added a 5 vote to your solution, so I hope it really is now the "above" solution.
MadMyche 15-Nov-18 15:28pm    
Thank you again, didn't think of that before I upvoted yours

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900