stdafx.h怎么导入?

night__cat 2006-08-05 09:44:19
本人在vc++6.0上写了一个c++程序,但是提示stdafx.h文件找不到。不知道是什么原因
...全文
3838 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
qpmzatao 2006-08-06
  • 打赏
  • 举报
回复
可以设置一下环境的呀!
snowbirdfly 2006-08-05
  • 打赏
  • 举报
回复
本人在vc++6.0上写了一个c++程序,但是提示stdafx.h文件找不到。不知道是什么原因~~~
那你建的工程是什么工程~~
假如你仅仅想编译C++程序,那么你可以新建工程为:WIN32 console application就可以了~~~
jinhengxyz 2006-08-05
  • 打赏
  • 举报
回复
这个问题不一定就是文件没有找到。。有可能你的程序中什么函数用错了。。。
折腾_苏州 2006-08-05
  • 打赏
  • 举报
回复 1
Stdafx.h是Visual C++为每个项目配置的用来预编译的文件,在Stdafx.h文件中可以加入应用程序所需的头文件;
这东西并非必需,是 VC 自动生成用来设置预编译头文件的,对于像 MFC 这样的工程可以提高编译速度。小工程或者头文件定义得好的化,不用也无所谓。

非要的话,你的其他SDK工程会有这个stdafx.h的,在机器上搜一下拿来用即可.

对于C++程序,可以把#include "stdafx.h" 直接注释掉,再自己添加所需要的头文件如
#include <stdio.h>
=====================================
附:我的有个SDK工程的stdafx.h内容:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#if !defined(AFX_STDAFX_H__4CE30D27_7EE3_4CD3_BF5D_BE525D0FE0E0__INCLUDED_)
#define AFX_STDAFX_H__4CE30D27_7EE3_4CD3_BF5D_BE525D0FE0E0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#include <stdio.h>

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__4CE30D27_7EE3_4CD3_BF5D_BE525D0FE0E0__INCLUDED_)

=================
不知我讲清楚了没有?
night__cat 2006-08-05
  • 打赏
  • 举报
回复
怎么写
XiangDong 2006-08-05
  • 打赏
  • 举报
回复
#include "stdafx.h"
自己写一个或者抄一个过来好了
night__cat 2006-08-05
  • 打赏
  • 举报
回复
是啊,但是在编译的时候提示没有stdafx.h文件
思危 2006-08-05
  • 打赏
  • 举报
回复
#include <stdafx.h>
lzg0001 2006-08-05
  • 打赏
  • 举报
回复
在工程设置中好像能删除掉 stdio.h 选项!
我对这东西也理解不透!
CSharp 调用C++ DLL; 参数为指针类型导出函数 c# Csharp调用 c++库 参数为导入和导出指针两种 包含C++ DLL源码 如fun(cont char* A,char*B) A为输入参数,B为输出参数-C# CSharp call C++ DLL lib dll function param use export and import eg: fun(cont char* A,char*B) A IN,B OUT TestDll\Debug\TestCallDll.exe .......\.....\TestCallDll.vshost.exe .......\.....\TestCallDll.vshost.exe.manifest .......\.....\TestDll.dll .......\.....\TestDll.lib .......\TestCallDll\Form1.cs .......\...........\Form1.Designer.cs .......\...........\Form1.resx .......\...........\obj\Debug\TestCallDll.csproj.FileListAbsolute.txt .......\...........\...\.....\TestCallDll.csproj.GenerateResource.Cache .......\...........\...\.....\TestCallDll.exe .......\...........\...\.....\TestCallDll.Form1.resources .......\...........\...\.....\TestCallDll.pdb .......\...........\...\.....\TestCallDll.Properties.Resources.resources .......\...........\Program.cs .......\...........\...perties\AssemblyInfo.cs .......\...........\..........\Resources.Designer.cs .......\...........\..........\Resources.resx .......\...........\..........\Settings.Designer.cs .......\...........\..........\Settings.settings .......\...........\TestCallDll.csproj .......\....Dll\dllmain.cpp .......\.......\ReadMe.txt .......\.......\stdafx.cpp .......\.......\stdafx.h .......\.......\targetver.h .......\.......\TestDll.cpp .......\.......\TestDll.def .......\.......\TestDll.h .......\.......\TestDll.vcproj .......\.......\TestDll.vcproj.PC-201008261742.Administrator.user .......\TestDll.sln .......\TestDll.suo .......\....CallDll\obj\Debug\TempPE .......\...........\...\Debug .......\...........\obj .......\...........\Properties .......\Debug .......\TestCallDll .......\TestDll TestDll
AppWizard has created this 3DSLoader application for you. This application not only demonstrates the basics of using the Microsoft Foundation classes but is also a starting point for writing your application. This file contains a summary of what you will find in each of the files that make up your 3DSLoader application. MySDOpenGL.dsp This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally. 3DSLoader.h This is the main header file for the application. It includes other project specific headers (including Resource.h) and declares the CMy3DSLoaderApp application class. 3DSLoader.cpp This is the main application source file that contains the application class CMy3DSLoaderApp. 3DSLoader.rc This is a listing of all of the Microsoft Windows resources that the program uses. It includes the icons, bitmaps, and cursors that are stored in the RES subdirectory. This file can be directly edited in Microsoft Visual C++. 3DSLoader.clw This file contains information used by ClassWizard to edit existing classes or add new classes. ClassWizard also uses this file to store information needed to create and edit message maps and dialog data maps and to create prototype member functions. res\3DSLoader.ico This is an icon file, which is used as the application's icon. This icon is included by the main resource file 3DSLoader.rc. res\3DSLoader.rc2 This file contains resources that are not edited by Microsoft Visual C++. You should place all resources not editable by the resource editor in this file. ///////////////////////////////////////////////////////////////////////////// For the main frame window: MainFrm.h, MainFrm.cpp These files contain the frame class CMainFrame, which is derived from CFrameWnd and controls all SDI frame

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧