1

I want to debug SGI STL in g++ (version 4.1.2) I downloaded source code in http://www.sgi.com/tech/stl/download.html and put them in a directory,such as /stl and then g++ -I/stl m.cpp but it causes a lot of complie errs,why?

m.cpp

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

Thanks

I just want to debug SGI STL in g++,what should I do?Is this feasible???

gotojyh
  • 19
  • 3

1 Answers1

1

Gcc looks here (subject to your exact setup)

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

But you can change that easily with g++ -nostdinc -I/stl m.cpp.

The compiler errors are likely cause by the different built in code, but we can't tell without seeing them.

user3125280
  • 2,779
  • 1
  • 14
  • 23
  • STL will call c++ standard library,so can't use -nostdinc. – gotojyh Jan 19 '14 at 02:27
  • What is the point of an stl (aka c++ standard library) that calls another? perhaps you mean it calls c standard library, in which case you will need to -I/path/to/c/headers which is described in the link (in fact my post shows the list but is missing the c++ header pat, whoops) – user3125280 Jan 19 '14 at 02:33