- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
`?-6ren"> `?-来自 here ,据说: For #include "filename" the preprocessor searches in the same directory as the file con-6ren">
来自 here ,据说:
For
#include "filename"
the preprocessor searches in the same directory as the file containing the directive. This method is normally used to include programmer-defined header files.For
#include <filename>
the preprocessor searches in an implementation dependent manner, normally in search directories pre-designated by the compiler/IDE. This method is normally used to include standard library header files.
同时 this wiki link建议 stdafx.h
是由 visual studio IDE
预先设计的头文件
stdafx.h is a file, generated by Microsoft Visual Studio IDE wizards, that describes both standard system and project specific include files that are used frequently but hardly ever change.
Compatible compilers (for example, Visual C++ 6.0 and newer) will precompile this file to reduce overall compile times. Visual C++ will not compile anything before the #include "stdafx.h" in the source file, unless the compile option /Yu'stdafx.h' is unchecked (by default); it assumes all code in the source up to and including that line is already compiled.
The AFX in stdafx.h stands for Application Framework eXtensions. AFX was the original abbreviation for the Microsoft Foundation Classes (MFC). While the name stdafx.h is used by default, projects may specify an alternative name.
然后
为什么我们使用#include "stdafx.h"
而不是 #include <stdafx.h>
?
最佳答案
A stdafx.h
, stdafx.cpp
pair 由 VS 从模板生成。它位于其余文件所在的同一目录中。您可能最终会专门为您的项目更改它。所以我们使用 ""
而不是 <>
正是因为它与您的第一句话描述的目录位于同一目录中。
关于c++ - 为什么我们使用 `#include "stdafx.h "` instead of ` #include <stdafx.h>`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37257725/
来自 here ,据说: For #include "filename" the preprocessor searches in the same directory as the file con
我有一个单独的文件夹用于我的包含,因为它是一个更大的应用程序的一部分,但我使用预编译的头文件来节省时间。但是,这意味着我需要 2 个或更多单独的 stdafx,因为我的头文件中也包含这些标准库。 最佳
这个问题已经有答案了: What is "stdafx.h" used for in Visual Studio? (5 个回答) 已关闭 6 年前。 该文件的用途是什么 stdafx.h 以及预编译
我正在使用 Visual Studio 2010 在 C++ 和 OpenGL 中制作 3D 模型。我在家里的电脑上开始了一个项目,然后决定把它放在一个存储库中,这样我就可以在我的笔记本电脑上获得用于
我正在使用文件夹结构中的“stdafx.h”(来自“src/resource/font.cpp”)。这编译得很好,但智能感知没有得到文件,所以它实际上被禁用了。您知道是否有解决方法吗? 最佳答案 预编
我有 MyClass.cpp 和 MyClass.h 文件。因为 MyClass.cpp 有 #include "MyClass.h" 我把 stdafx.h 放到 MyClass.h 中。编译期间出
我有包含各种 C++ 项目的 visual studio 解决方案。为简单起见,有两个项目。一个用于 .lib,另一个用于 .exe。这两个项目都使用预编译头文件 stdafx.h。但是预编译头在项目
我有这个极其简单的主函数 #include "stdafx.h" #include "abc.h" int _tmain(int argc, _TCHAR* argv[]) { abc obj
在一个 visual studio 解决方案中,我有两个 vcproj,一个叫做 kernellib.vcproj,另一个叫做 kernerlibtest.vcproj。可以猜到,后者是前者的单元测试
我有一个简单的测试控制台应用程序。我正在尝试使用 simple.h 文件中定义的函数 nike2,实现在 simple.cpp 中。 simple.h 和 simple.cpp 文件都位于与主项目不同
我有两个包含文件头 #include "stdafx.h" #include "psapi.h" 但是它给出了无法打开源文件“stdafx.h”的编译时错误。我正在使用 Visual Studios
嘿,过去几天我一直在关注 learncpp.com tuts,他们说要从 Code::Blocks 的 .cpp 文件中注释掉“#include “stdafx.h”。 删除 include 行是必须
在 VS 中启用“显示所有文件”选项后,我添加了一个文件夹并在该文件夹中创建了一个新类。由于我使用的是预编译头文件,因此我还需要包含相对于新类文件的根目录中的 stdafx.h。 在我的 cpp 文件
我有一个名为 stdafx.h 的头文件,当然这个是预编译的。我已经读过我应该将这些文件包含到我的 .cpp 文件中,但是其中一些语句已经在随附的头文件中需要。 我应该将 stdafx 添加到我的标题
在分离依赖方面,正确使用stdafx.h的方法是什么? 如果我将 所有内容 都放在那里,那么我的编译速度会非常快,我需要在任何文件中说的是 #include "stdafx.h" 需要注意的是: 我不
我有一个基于 Visual Studio C++ 的程序,它使用预编译的头文件 (stdafx.h)。现在我们正在使用 gcc 4.x 将应用程序移植到 Linux。 问题是如何在两种环境中处理预编译
我看到了很多代码,包括 stdafx.h。说,我确实不想要预编译的 header 。我将自己手动包含所有必需的系统 header 。在那种情况下,我应该知道我在哪里需要 stdafx.h 有什么其他好
这个问题在这里已经有了答案: What is "stdafx.h" used for in Visual Studio? (5 个回答) 关闭5年前。 stdafx.h 文件的用途是什么?预编译头文件
我刚开始使用 Visual Studio 2013。在我开始将 #include "stdafx.h"放在每个 cpp 文件的开头之前,我的代码无法编译。别人通过linux终端去编译我的代码会不会出问
我有一个 Visual Studio 2010 解决方案,其中包含几个密切相关的项目。想要摆脱复制粘贴代码共享并在项目之间共享一些通用类。我们已尝试将对项目 A 中的类的引用添加到项目 B 中,但在共
我是一名优秀的程序员,十分优秀!