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 ".

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


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