我想在 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/