[matroska-devel] Re: Namespace pb

Cyrius suiryc at yahoo.com
Tue Apr 8 16:21:30 CEST 2003


--- Steve Lhomme <steve.lhomme at free.fr> wrote:
> OK. Now I see what the problem is. As the compiler
> says, you already define some
> types that are already defined...
> 
> Now the libraries are supposed to be usable in any
> application and so they
> should fit in the code without much problem. That's
> what namespaces are for. I'm
> a bit surprised that when you put
> START/END_LIBEBML_NAMESPACE around the code it
> still produces the same. Your compiler might not be
> able to handle namespaces
> properly then (which I don't think is the case).

Well we are talking of MSVC++6 here, so we never know
:p

> Maybe you didn't include the
> file that specify what is in the namespace (ie
> EbmlConfig.h) ?

I tried including this file too but this didn't helped
(still getting 'redefinition' or 'ambiguous symbol'
errors).

> Also this should be done but it's not enough.
> Because there are some ancient
> compilers like GCC 2.95 that don't understand
> standard C++ (ie namespaces). And
> if you use libebml/libmatroska with other C++ code
> that already defined uint8
> you'll end up with the same error as yours... So
> there should be in the code
> something like this :
> 
> #if (!EBML_CLASSIC_TYPES_DEFINED)
> ...define them as it is now
> #endif
> 
> There won't be any duplicate anymore... But there is
> another problem : the
> library has to be compiled with these same types as
> you use in your own code !
> Hopefully this is the case but you never know. And I
> don't see any way to
> enforce that :( (unless we have a "port.h" file for
> each platform)

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
http://www.matroska.org



More information about the Matroska-devel mailing list