This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: C++ compiling problem


Tony Ko wrote:
> > I added new file XXX.cxx , XXX.hxx to eCos-1.3.1 package.
> > but some weird compile error happened.
> > Error message shows errors happened at
> > "Install_Dir/include/lib/libkern/libkern.h ".
> 

Martin wrote:
> Are you trying to use STL in your C++ code? If so, I know 
> what's wrong:
> 
> libkern.h declares some inline functions, one of them called min()
> (OUCH!). STL defines a template called called min() as well. If you
> include both header files, libkern.h's min() will override 
> the STL one.
> 
> Of course, STL then runs into problems when it actually tries 
> to use its
> own version of min() but gets the wrong one (which is only 
> declared but
> not defined, BTW).
> 
> I already reported this problem to RedHat (we've got a support
> contract), but haven't heard anything so far. :-(
> On workaround might be to hack libkern.h to completely omit these
> functions. AFAIK, they're not used anyway.
> 
> Martin

yes, right ! 
library overlapping was problem. 
so now compiling error does not occuar at
"Install_Dir/include/lib/libkern/libkern.h"

but still has some errors while compiling.
it seems compiler cannot recognize class declaration on XXX.hxx file at
all.
but compiler compiles kernel-related XXX.hxx files well.
just new added XXX.hxx file is not compiled. 
so any additional option should I add ?

thanks in advance.

Tony




 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]