C++库冲突
build C++代码报错
错误原因是因为new这个方法在
/data/build/tmf814/INC/NSP/baseobj/nspobject.h: In function `void* operator
new(unsigned int, void*)':
在本地nspobject.h中重复定义了new,因为build工程代码需要用到重新定义的new对象。
但是编译本地工程的时候同时需要用到std的new,这个时候他们的引用就出现了冲突,冲突错误如下:
错误打印如下:
root@ICOMM1 # root@ICOMM1 # ./build_tmf814.sh increaseTMF814 version: "1.10.0.71"TMF814 OEM: "UTStarcom"build type: increase/data/build/tmf814/BUILD/Solaris/gcc/release/tmfstart.out: No such file or directoryGNUmakefile: /data/build/tmf814/WSP/Solaris/gcc/GNUmakefile MAKEFLAGS=exceptions=1 BUILDTYPE=release ROOTDIR=/data/build/tmf814compiling : /data/build/tmf814/SRC/TMFTools/AlarmTools.cppg++ -D_REENTRANT -I/data/build/ACE_wrappers -DACE_HAS_EXCEPTIONS -D__ACE_INLINE__ -fvolatile -DRW_MULTI_THREAD -D_REENTRANT -D_LANG_TYPEDOC_CH -DLITTLE_ENDIAN_VTBL -DNSP_BIG_ENDIAN -DNSPM_NEED_ALIGN -DSOLARIS -DPLUGINS_TLS -D_LANG_TYPEDOC_CH -DCPU=SPARC -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I/data/build/tmf814/INC -I/data/build/tmf814/INC/NSP -I/data/build/tmf814/INC/SI -I/data/build/tmf814/INC/GLOBAL -I/data/build/tmf814/INC/CORBA -I/data/build/tmf814/INC/IDL -I/data/build/ACE_wrappers/ -I/data/build/ACE_wrappers/TAO -I/data/build/ACE_wrappers/TAO/orbsvcs -I/data/build/ACE_wrappers/TAO/orbsvcs/orbsvcs -O2 -c /data/build/tmf814/SRC/TMFTools/AlarmTools.cpp -o obj/AlarmTools.o In file included from /data/build/tmf814/INC/NSP/memimp/nspmemimp.h:13, from /data/build/tmf814/INC/NSP/nsptool/nsptool.h:12, from /data/build/tmf814/INC/NSP/nspmag/nspmag.h:14, from /data/build/tmf814/INC/NSP/noi/noitypelib.h:13, from /data/build/tmf814/INC/NSP/noi/noi.h:18, from /data/build/tmf814/INC/SI/hruifault.h:11, from /data/build/tmf814/INC/GLOBAL/TMFTools/AlarmTools.h:16, from /data/build/tmf814/SRC/TMFTools/AlarmTools.cpp:10:/data/build/tmf814/INC/NSP/baseobj/nspobject.h: In function `void* operator new(unsigned int, void*)':/data/build/tmf814/INC/NSP/baseobj/nspobject.h:24: error: redefinition of ` void* operator new(unsigned int, void*)'/usr/local/include/c++/3.3.2/new:92: error: `void* operator new(unsigned int, void*)' previously defined here/data/build/tmf814/INC/NSP/baseobj/nspobject.h:24: error: redefinition of ` void* operator new(unsigned int, void*)'/usr/local/include/c++/3.3.2/new:92: error: `void* operator new(unsigned int, void*)' previously defined here