<>之间的差异和“”在MSVC中

时间:2013-01-01 16:40:32

标签: c++ visual-studio-2010 include crystal-space-3d

  

可能重复:
  What is the difference between #include <filename> and #include “filename”?
  include “file.h” vs <file> what is the difference?

我在使用外部库时遇到过这种情况,我认为这纯粹是因为我缺乏经验。标题中我的问题是使用&lt;&gt;之间的区别是什么?在include和“”中,它显然是一个很大的,因为你不能用&lt;&gt;包含你自己的标题但是您可以使用“”,反之亦然,您不能将<string>和“”等标题包含在内。

我现在正在使用Crystal Space SDK,我正在努力掌握它并遵循教程。我正在按照Creating-External-MSVC-Application Howto指南进行操作并遇到此错误:

1>------ Build started: Project: NewDawn, Configuration: Debug Win32 ------
1>  simple1.cpp
1>f:\project\newdawn\newdawn\include\cs\csplatform.h(26): fatal error C1083: Cannot open include file: 'csutil/win32/csconfig-msvc.h': No such file or directory
1>  main.cpp
1>f:\project\newdawn\newdawn\include\cs\csplatform.h(26): fatal error C1083: Cannot open include file: 'csutil/win32/csconfig-msvc.h': No such file or directory
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我去了找到文件csplatform.h并发现它包含文件csconfig-msvc.h使用&lt; &GT;:

#if defined (CS_WIN32_CSCONFIG)
/* Use manually maintained settings when not building on environments not
* using configure (specifically, MSVC) */
#  include <csutil/win32/csconfig-msvc.h>
#else
#  include <csconfig.h>
#endif

理论上我可以从&lt;改变#include csutil / win32 / csconfig-msvc.h &GT; “但我不应该这样做,这是一个完善的代码库,最简单的教程应该直接使用。

我想知道它为什么用&lt; &GT;并不是 ” ”。如果我没记错的话,我看到Boost也做了。

1 个答案:

答案 0 :(得分:0)

#include <some file>使用包含搜索路径。 #include "some file"与正在编译的文件有关。因此,如果您想使用#include <some file>,则需要修改包含搜索路径。

相关问题