0

尝试在 Solaris intel i386 上使用 developertudio12.6 CC 编译 C++ 程序。编译器不显示错误或警告但失败。

可能会弄清楚为什么 CC 不显示任何警告或错误 - 可能出了什么问题?

developerstudio12.6/bin/CC  -mt -xtarget=native -m32 -g  -errwarn=%all  -O -DNDEBUG  -c xml_test.cc -I<some include> -I<some other include> -o xml_test.o
echo $?
2

使用 -verbose=template => 类似的输出,没有调试行使用 -# 或 verbose=diags=> 大量输出但没有错误行

### CC: Note: NLSPATH =   `/opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat`
###     command line files and options (expanded):
### -mt=yes -xtarget=native -xchip=broadwell -xcache=32/64/8/2:256/64/8/2:30720/64/20/24 -xarch=avx2_i -m32 -xdebuginfo=line,param,variable,tagtype,codetag,decl -xglobalize=yes -xpatchpadding=fix -Qoption driver -dconditional=yes -xkeep_unref=funcs,vars -verbose=diags -O3 -DNDEBUG -c xml_test.cc -I<some include> -I<some include> -oxml_test.o
/opt/developerstudio12.6/lib/compilers/bin/ccfe -D__SunOS_5_11 -D__SunOS_RELEASE=0x051100 -D__SUNPRO_CC=0x5150 -D__unix -D__SVR4__ -D__svr4__ -D__SVR4 -D__sun -D__sun__ -D__SunOS -D__i386 -D__i386__ -D__ORDER_LITTLE_ENDIAN__=1234 -D__ORDER_BIG_ENDIAN__=4321 -D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__ -D__BUILTIN_VA_ARG_INCR -Dunix -Dsun -Di386 -D__FP_FAST_FMA__ -D__FP_FAST_FMAF__ -D_REENTRANT -D__SUN_PREFETCH -D__SUNPRO_CC_COMPAT=5 -I<some include> -I<some include> -I-xbuiltin -I/opt/developerstudio12.6/lib/compilers/include/CC/Cstd -I/opt/developerstudio12.6/lib/compilers/include/CC -I/opt/developerstudio12.6/lib/compilers/include/cc -DNDEBUG -ptf /tmp/ccfe.1620226479.15666.03.%1.%2 -ptx /opt/developerstudio12.6/bin/CC -ptk "-mt=yes -xtarget=native -m32 -xdebuginfo=line,param,decl,variable,tagtype,codetag -xglobalize=yes -xpatchpadding=fix -xkeep_unref=funcs,vars -verbose=diags -O3 -DNDEBUG -c -I<some include> -I<some include> " -compat=5 -xglobalize=yes -xdebuginfo=line,param,variable,tagtype,codetag,decl -instlib=/opt/developerstudio12.6/lib/compilers/libCstd.a -xdbggen=dwarf+usedonly+incl+line+param+variable+tagtype+codetag+decl -xF=%none -xbuiltin=%default -xldscope=global -xivdep=loop -xdepend -O3 -xarrayloc xml_test.cc -ptb xml_test.o -o /tmp/ccfe.1620226479.15666.01.ir 2> /tmp/ccfe.1620226479.15666.02.err

/opt/developerstudio12.6/lib/compilers/stdlibfilt -stderr < /tmp/ccfe.1620226479.15666.02.err

4

2 回答 2

0

您的NLSPATH环境变量不正确。

/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat引用/opt/lib/locale/%L/LC_MESSAGES/%N.cat而不是/opt/developerstudio12.6/lib/locale/%L/LC_MESSAGES/%N.cat因为你有一个额外的..元素。

于 2021-05-06T02:12:38.067 回答
0

不久前,我通过添加-filt=%none编译器选项解决了这个问题:

-mt -xtarget=native -m32 -filt=%none -g2 -verbose=template -errtags -library=iostream 
于 2021-05-18T12:42:01.510 回答