Hi people!
I've got this own library:
--------------------------------------------
Personal.h
--------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
....
MY_STREAM *wprintf(MY_STREAM *_this, const char *format, ...);
....
#ifdef __cplusplus
}
#endif
Well, this function 'wprintf()' already exists in /usr/include/wchar.h. I can't change Personal.h, because is a customer's library.
I have problems when i try to compile a C++ program -my_program.C- (each one that includes Personal.h).
More, compiling it in a HP-UX B.11.11 PA_RISC (with CC compiler) it was OK. But now, compiling it in a HP-UX B.11.23 ITANIUM (with aCC) I obtain this error:
"/usr/include/wchar.h", line 134: error #2338: more than one instance of overloaded function "wprintf" has "C" linkage
extern int wprintf __((const wchar_t *, ...));
^
It could be a problem in the order of include files passing to the compiler, but i think it's fine.
I put down the logs of compiler (using option -v). I hope someone can help me.
Best regards!
--------------------------------------------
HP-UX B.11.11 PA-RISC (CC)
--------------------------------------------
/opt/CC/bin/CC -v
-D_HPUX_SOURCE -DHPUX -DHP9800 -DVERMAJOR=10 -DVERMINOR=0 -DSYSV -DMOTIF -DY2000 -DSPANIEN
+a1 -Aa +DAportable +DS1.1 +z -c /..../my_program.C
-I<all my include dirs, here are included Personal.h>
/opt/langtools/lbin/cpp.ansi
-D_HPUX_SOURCE -DHPUX -DHP9800 -DVERMAJOR=10 -DVERMINOR=0 -DSYSV -DMOTIF -DY2000 -DSPANIEN
-I<all my include dirs, here are included Personal.h>
-D__hp9000s700 -D_PA_RISC1_1 -$ -Z -Dc_plusplus -D__cplusplus -D__hp9000s800 -D__hppa -D__hpux -D__unix -Dhp9000s800
-Dhppa -Dhpux -Dunix -I/opt/CC/include/CC -I/usr/include /..../my_program.C /var/tmp/AAAa05164.i
/opt/CC/lbin/cfront +DAportable +DS1.1 +z +a1 +b1 +T/var/tmp/BAAa05164 +s +t/var/tmp/CAAa05164
+f/..../my_program.C +XCddp_data.o </var/tmp/AAAa05164.i
--------------------------------------------
HP-UX B.11.23 ITANIUM (aCC)
--------------------------------------------
/opt/aCC/lbin/ecom -architecture 32 -ia64abi all -inst compiletime
-sysdir /usr/include -test namespaces -koenig_lookup on -ansi_for_scope on -inline_power 1 -link_type dynamic
-fpeval float -fpevaldec _Decimal32 -tls_dyn on -target_os 11.23
<all my include dirs, here are included Personal.h>
--sys_include /opt/aCC/include_std
--sys_include /opt/aCC/include_std/iostream_compat
--sys_include /usr/include --sys_include /usr -D_HP_IA64ABI -D_BIND_LIBCALLS -D_Math_errhandling=MATH_ERREXCEPT
-D__hpux -D__unix -D__ia64=1 -D__ia64__=1 -D_BIG_ENDIAN=1 -D__STDCPP__ -D_HP_NAMESPACE_STD -D_ILP32
-D__cplusplus=199711L -D_INCLUDE__STDC_A1_SOURCE -D__HP_aCC=62000 -D_HP_INSTANTIATE_T_IN_LIB -D_INLINE_ASM
-D_FLT_EVAL_METHOD=0 -D_DEC_EVAL_METHOD=0 -D_HPUX_SOURCE -DHPUX -DHP9800 -DVERMAJOR=10 -DVERMINOR=0 -DSYSV
-DMOTIF -DY2000 -DSPANIEN -ucode hdriver=optlevel%1% -plusolistoption -Ol06all! -plusolistoption -Ol13moderate!
-plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,es,rs,Rf,Pr,sp,in,cl,om,vc,pi,fa,pe,rr,pa,pv,nf,cp,lx,Pg,ug,l
u,lb,uj,
dn,sg,pt,kt,em,np,ar,rp,dl,fs,bp,wp,pc,mp,lr,cx,cr,pi,so,Rc,fa,ft,fe,ap,st,lc,Bl,sr,Qs,do,ib,
pl,sd,ll,rl,dl,
Lt,ol,fl,lm,ts,rd,dp,If!
/..../my_program.C