I am trying to use MFC with ProC.
Functions.pc is where I do the ProC syntax to connect to the database. So I include the 'Functions.h'
in the dialog model where I want to call the functions in 'Funtions.h'
. And now I got this error.
Add directive to 'stdafx.h' or rebuild precompiled header
I understand that I need to include 'stdafx.h'
to 'Functions.h'
for it to work. And I did that. It can compile,but then when I try to run the program,it won't recognize the syntax of ProC created by the 'Functions.cpp'
created. I don't really understand how to rebuild the precompiled header since I don't understand the codes in 'stdafx.h'
.
You can choose to not use precompiled headers, and you can specify the header file name and the name and path of the output file. Custom precompiled code For large projects that take significant time to build, you may want to consider creating custom precompiled files.
The purpose of the file is to speed up the build process. Any stable header files, for example Standard Library headers such as <vector>, should be included here. The precompiled header is compiled only when it, or any files it includes, are modified.
Your program comprises multiple modules, all of which use a standard set of include files and the same compilation options. In this case, all include files can be precompiled into one precompiled header. The first compilation — the one that creates the precompiled header (PCH) file — takes a bit longer than subsequent compilations.
Structure of a Makefile That Uses a Precompiled Header File Beginning at the top of the diagram, both STABLEHDRS and BOUNDRY are NMAKE macros in which you list files not likely to need recompilation. These files are compiled by the command string CL /c /W3 /Yc$(BOUNDRY) applib.cpp myapp.cpp
Within VS 2012 you can set the properties of the Project, the Solution, or Source File(s) to not use Precompiled Headers. See attached graphic for how to do it... VS Turn off Precompiled Headers
Found the solution myself. I need to set the properties of that .cpp file to not using any pre-compiled header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With