The --sysroot
switch is useful when you don't want the headers/libraries in the standard paths affect your build.
--sysroot=dir
: Use dir as the logical root directory for headers and
libraries. For example, if the
compiler would normally search for
headers in /usr/include and libraries
in /usr/lib, it will instead search
dir/usr/include and dir/usr/lib. [ref]
Can the same thing be accomplished through the use of environment variables, the gcc specs file, or any other methods that do not require command line switches?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…