将标准库添加到 C++ eclipse 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6869570/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding standard libraries to C++ eclipse project
提问by snappy
A (very) newbie C++ question: Is there a way to automatically add the standard libraries to a C++ eclipse project? I installed the CDT Main Features plugin.
一个(非常)新手 C++ 问题:有没有办法将标准库自动添加到 C++ eclipse 项目中?我安装了 CDT 主要功能插件。
回答by ks1322
You can manually add paths to STL headers in Paths and Symbols -> Includes tabin Project Properties. This would enough for Indexer to resolve STL symbols properly.
您可以在“路径和符号”->“项目属性”中的“包含”选项卡中手动添加到 STL 标头的路径。这足以让 Indexer 正确解析 STL 符号。
回答by NuclearPeon
If you need a compiler, make sure you have a visual studio installed, or cygwin; If you install cygwin, be sure to install the gcc and g++ compiler options which are deselected by default.
如果需要编译器,请确保安装了 Visual Studio 或 cygwin;如果您安装 cygwin,请务必安装默认取消选中的 gcc 和 g++ 编译器选项。
Point eclipse to the installed files and you should be good to go.
将 eclipse 指向已安装的文件,您应该很高兴。