cc1plus:错误:无法识别的命令行选项“-fsysroot = <path>”with g ++ </path>

时间:2014-10-07 05:12:01

标签: c++ compilation compiler-errors g++

我试图在64位计算机上的模拟32位环境(cel5.03-i386-2.3)中编译大型C ++项目。 (编译之前在32位机器上运行良好)

在编译期间,某些文件会失败,如下所示。奇怪的是,传递给g ++命令的参数是“ - sysroot =”,而在错误消息中它变为“ - fsysroot =”

为什么会发生这种情况?

/usr/bin/g++ -MMD -MF /proj/src/.debug/lib/osiris/core/utils/WWNConverter.d  -I/proj/src/lib/osiris -DDEBUG_LOG -DDEBUG -D_REENTRANT -DAPE_MODE  -DSWAT_MODE -g -Werror -Wall -Wno-write-strings -fPIC -m32 --sysroot=/auto/andpkg/rep_cache//wr-x86/3.0FCS/sysroot -rdynamic -I/proj/src -I/proj/src/.debug/include/private -I/proj/src/.debug/include/public -I/proj/src/lib/framework -I/proj/src/lib/osiris -I/proj/src/lib/prt -I/proj/src/lib/callhome -I/proj/src/lib/snmp  -I/proj/src/.debug/external/pcre/include -I/proj/src/external/sqlite/include -I/proj/src/external/openssl/openssl-fips-1.2.3/include -I/proj/src/support/storage-driver/include -I/proj/src/external/json/include -DTARGET_OBJECT=libosiris.so -I/proj/src/.debug/external/pcre/include -I/proj/src/.debug/external/libcurl/include -o /proj/src/.debug/lib/osiris/core/utils/WWNConverter.o -c /proj/src/lib/osiris/core/utils/WWNConverter.cc

make[1]: *** [/proj/src/.debug/lib/osiris/core/utils/WWNConverter.o] Error 1
cc1plus: error: unrecognized command line option "-fsysroot=/auto/andpkg/rep_cache//wr-x86/3.0FCS/sysroot"

1 个答案:

答案 0 :(得分:1)

32位编译器(GCC 3.4.6)太旧了,无法支持--sysroot选项,该选项已添加到主干commit 102367,并且在GCC 4.1之前没有进入发布分支。 0

2005-07-25  Mark Mitchell  <mark@codesourcery.com>
  * gcc.c (option_map): Add --sysroot.
  (process_command): Handle --sysroot.
  (display_help): Document it.
  * doc/cppopts.tex (-isysroot): Document.
  * doc/invoke.texi (--sysroot): Document.
  * doc/install.texi (--with-build-sysroot): Document.

  * Makefile.in (inhibit_libc): New variable.
  (INHIBIT_LIBC_CFLAGS): Likewise.
  (LIBGCC2_CFLAGS): Include
  $(INHIBIT_LIBC_CFLAGS).
  (CRTSTUFF_CFLAGS): Include $(INHIBIT_LIBC_CFLAGS).
  ($(T)crtbegin.o): Do not use @inhibit_libc@.
  ($(T)crtend.o): Likewise.
  ($(T)crtbeginS.o): Do not use @inhibit_libc@.
  ($(T)crtendS.o): Likewise.
  ($(T)crtbeginT.o): Do not use @inhibit_libc@.
  ($(T)crtendT.o): Likewise.
  (stmp-fixinc): Do not complain about missing headers if
  inhibit_libc.
  * configure.ac (inhibit_libc): Set it to true/false.
  (--with-build-sysroot): New option.  Use it to set
  SYSTEM_HEADER_DIR. 
  * configure: Regenerated.