而建议stdafx.h是visual studio IDE预先设计的头文件。
H是一个由向导生成的文件,它描述了标准系统和特定于项目的文件,包括经常使用但很少更改的文件。在源文件中包含"stdafx.h“之前,Visual C++将不会编译任何内容,除非未选中编译选项/Yu'stdafx.h‘(默认情况下);它假定源代码中的所有代码都已经编译完毕,并包含了该行。在stdafx.h中的AFX代表Application。AFX是Microsoft类(MFC)的原始缩写。在默认情况下使用s
直到我开始将#include "stdafx.h“放在每个cpp文件的开头,我的代码才会编译。当其他人通过Linux终端编译我的代码时,这会引起什么问题吗?如果我只是从下面的代码中删除#include "stdafx.h“,它会用C++11编译g++吗?#include "stdafx.h"using std::cout; using std::endl; using std::cin;
using namespace
控制台应用程序:#include "..\..Did you forget to add '#include "StdAfx.h"' to your source?魔法"StdAfx.h“是用来做什么的?更新#include "C:\c\usingHeader\usingHeader\stdafx.h"
#include
warning C4627: '#include "Angel.h"': skipped when looking for precompiled header useforget to add '#include "stdafx.h"' to your source
但实际上,我已经包含了stdafx.h,并且我使用Visual 2012创建了带有预编译头的项目#include
我有一个VisualStudio2017 C++项目,它使用预编译的头(stdafx.h)。我的(简化)文件结构如下:header2.hppcode1.cpp -> includes stdafx.hcode2.cpp -> includes stdafx.h and header2.hpp
为了避免任何歧义,我说includes header1.hpp,我的意思是文件中有一行#include <在我修改<