我需要使用标准库头的修改版本来编译一些文件.使用Visual C++编译器,我将通过使用/ X(忽略标准包含路径)和/ I(其他包含目录)参数来完成此操作.如何使用gcc完成这项工作?
Meh*_*ari 54
gcc -nostdinc -I/custom/include/path/goes/here
Run Code Online (Sandbox Code Playgroud)
-nostdinc忽略标准C包含目录
-nostdinc++忽略标准C++包含目录
如果您只是添加-I到命令行,您将看到(特别是如果您还添加-v)gcc将在查找任何其他文件夹之前首先查看这些文件夹.因此您无需添加--nostdinc)以使用备用STL库.
这样就使用了STLPort:
g++ -I path-to-stlport-include main.cpp -L path-to-stlport-lib -lstlport