I need to compile some files with a usage of modified versions of standard library headers. With Visual C++ compiler I will do this by usage of /X (Ignore Standard Include Paths) and /I (Additional Include Directories) parameters. How this should be done with gcc?
41
votes
2 Answers
59
votes
11
votes
If you just add -I to your command line you will see (especially if you also add -v) that gcc will look in these folders first before looking in any other folders. So you don't need to add --nostdinc) in order to use an alternative STL library.
In this way STLPort is used:
g++ -I path-to-stlport-include main.cpp -L path-to-stlport-lib -lstlport