In a C++ MFC project, how can I use the functions in a .c file?
it shows the following error when I add test.c and test.h file in the project: "unexpected end of file while looking for precompiled header directive"
it shows the following error when I add test.c and test.h file in the project: "unexpected end of file while looking for precompiled header directive"
解决方案 »
- 在界面上输出文字,结果无法更改文字的大小
- CCheckListBox是怎么加到对话框的?
- 求<<Visual C++6.0 宝典>>的光盘源码
- 初学线程,谁给一个运行简单线程的例子,最好有注释,3Q
- InstallShield高手请进.高分回答。如何在InstallScript中调用VC#.net开发的组件???
- ReadFile()出现ERROR_NOACCESS错误?
- MFC中 &CView::classCView 返回什么?
- 初学ado遇到问题,请大虾帮忙解决.
- 请教关于打印的问题
- 图象小角度旋转边缘锯齿问题
- 请问在SDI界面菜单的一个子菜单响应一个调用,调用一个对话框,加入一些代码出错(如题),希望指点!
- 还是如何更改标题的问题?
"fatal error C1853: 'Debug/test02.pch' is not a precompiled header file created with this compiler"If I set the Project Setting --> C/C++ --> Category --> Precompiled Hearders --> Not using precompiled headers, it shows the following error:
"c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(15) : fatal error C1189: #error : MFC requires C++ compilation (use a .cpp suffix)"
This problem can be resolved in several ways depending on the situation: Resolution I
For projects with a single C source file and multiple C++ source files (or vice-versa), use the following steps to disable precompiled headers for the single source file:
For the current target, open the Project Settings dialog box and select the Precompiled Headers section under the C/C++ Tab. Select the C file from the project tree in the left pane. For Visual C++ version 2.x, disable the Use .PCH File checkbox in the Per-File Use of Precompiled Headers. For Visual C++ version 4.0, select the Not using precompiled headers option button. Save the new settings and build the project. Resolution II
For projects with multiple C and C++ source files, use the following steps to disable precompiled headers for a set of source files procedure:
With Visual C++ version 2.x: 1. For the current target, create a New Group by choosing New Group from
the Project menu item. 2. Move the C source files into the new group. 3. Open the Project Settings and select the Precompiled Headers section
under the C/C++ tab dialog. 4. Select the new group from the project tree in the left pane. 5. Disable the Use .PCH File checkbox in the Per-File Use of Precompiled
Headers. 6. Save the new settings and build the project. This will disable precompiled headers for a set of source files. However,
source files in subsequent additions to this group may need the PCH usage
disabled depending on the file's previous settings. With Visual C++ version 4.0, groups are no longer supported. To disable
the use of precompiled headers for a group of source files, follow the
the steps of Resolution I, but in step 2 hold down the CRTL key while
selecting each file.
Resolution III
For projects not requiring precompiled headers, follow the steps of Resolution I, but in step 2 select all targets from the project tree in the left pane. Resolution IV (VC 4.x and 5.0)Create a subproject of type "Static Library". Insert the .C files into this subproject. Delete the .C files from the top-level project. Add the resulting library or .obj files to the link line for the top-level project. This will allow you to specify a pre-compiled header for the top-level project (.CPP files), and a different pre-compiled header for the subproject (.C files).