c++ - 如何在 g++ 中使用 sgi STL

标签 c++ stl g++ sgi

我想在 g++(版本 4.1.2)中调试 SGI STL 我在http://www.sgi.com/tech/stl/download.html下载了源码并将它们放在一个目录中,例如/STL 然后 g++ -I/STL m.cpp 但是它会导致很多编译错误,为什么?

m.cpp

#include "list" //I want to include **/STL** not **/usr/include/c++/...**
using namespace std
int main()
{return 0;}

谢谢

我只想在g++中调试SGI STL,我该怎么办?这可行吗???

最佳答案

Gcc looks在这里(取决于您的具体设置)

GCC looks in several different places for headers. On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with #include in:

 /usr/local/include
 libdir/gcc/target/version/include
 /usr/target/include
 /usr/include

但是您可以使用 g++ -nostdinc -I/STL m.cpp 轻松更改它。

编译器错误可能是由不同的内置代码引起的,但我们无法在没有看到它们的情况下判断。

关于c++ - 如何在 g++ 中使用 sgi STL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21205669/

相关文章:

c++ - "placement new"具有通用成员变量的结构/类数组的正确方法是什么?

c++ - 复制的 std::list 中的垃圾

c++ - 如何使用 STL 算法和仿函数按值删除 std::map 单元格?

python-3.x - JCC无法链接python3.5进行pylucene安装

c++ - 模板参数类型成员上的运算符 << 仅在 clang 中导致错误

c++ - 使用 Windows USB 虚拟 Com 端口识别断开连接事件

c++ - std::random_shuffle 每次产生相同的结果

C++ unique_ptr<Base> 指向 Derived 的 ptr

c++ - 在模板类中使用 STL 算法(特别是 std::sort)

c++ - aws-sdk-cpp:未解析的符号