[Matroska-devel] Problem (and possible solution) compiling libmatroskadll in Visual Studio 2005

Peter Romba promba at gmail.com
Wed May 7 18:22:05 CEST 2008


Hi guys, I'm a new member here.

I recently downloaded libmatroska-0.8.1 and libebml-0.7.8, and I'm having
trouble getting the libmatroskadll project to compile in Visual Studio
2005.  libeml, libemldll, and libmatroska all compile OK, but when I try to
compile libmatroskadll, I get hundreds of errors.  Here are the first few
that come up, including the warnings immediately before them:

1>------ Rebuild All started: Project: libmatroskadll, Configuration: Debug
Win32 ------
1>Deleting intermediate and output files for project 'libmatroskadll',
configuration 'Debug|Win32'
1>Compiling...
1>KaxAttached.cpp
1>d:\libebml\ebml\ebmlcrc32.h(146) : warning C4311: 'type cast' : pointer
truncation from 'const void *' to 'unsigned long'
1>d:\libebml\ebml\ebmlcrc32.h(146) : warning C4311: 'type cast' : pointer
truncation from 'const void *' to 'unsigned long'
1>d:\libebml\ebml\ebmlmaster.h(165) : warning C4251:
'libebml::EbmlMaster::ElementList' : class 'std::vector<_Ty>' needs to have
dll-interface to be used by clients of class 'libebml::EbmlMaster'
1>        with
1>        [
1>            _Ty=libebml::EbmlElement *
1>        ]
1>d:\libebml\ebml\ebmlunicodestring.h(83) : warning C4251:
'libebml::UTFstring::UTF8string' : class
'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be
used by clients of class 'libebml::UTFstring'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>d:\libebml\ebml\ebmlstring.h(75) : warning C4251:
'libebml::EbmlString::Value' : class 'std::basic_string<_Elem,_Traits,_Ax>'
needs to have dll-interface to be used by clients of class
'libebml::EbmlString'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>d:\libebml\ebml\ebmlstring.h(76) : warning C4251:
'libebml::EbmlString::DefaultValue' : class
'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be
used by clients of class 'libebml::EbmlString'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>d:\libmatroska-0.8.1\matroska\kaxcontexts.h(82) : error C2059: syntax
error : '__declspec(dllexport)'
1>d:\libmatroska-0.8.1\matroska\kaxcontexts.h(83) : error C2059: syntax
error : '__declspec(dllexport)'
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(70) : error C2065:
'GetKaxGlobal_Context' : undeclared identifier
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(70) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(71) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(72) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(73) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(74) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(75) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available
1>d:\libmatroska-0.8.1\src\kaxattached.cpp(77) : error C2512:
'libebml::EbmlSemanticContext' : no appropriate default constructor
available


Lines 82 and 83 of kaxcontexts.h are:

extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxGlobal_Context();
extern const EbmlSemanticContext & MATROSKA_DLL_API
GetKaxTagsGlobal_Context();

I noticed that if I change the lines as follows, the code compiles and links
perfectly:

extern const EbmlSemanticContext MATROSKA_DLL_API & GetKaxGlobal_Context();
extern const EbmlSemanticContext MATROSKA_DLL_API &
GetKaxTagsGlobal_Context();

Is this a known issue?  Does VS2005 just interpret the address operator
differently than previous versions?  I haven't tried compiling the original
code in 2003 or VC6 yet.

Thanks
--Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.matroska.org/pipermail/matroska-devel/attachments/20080507/91ba134d/attachment.html>


More information about the Matroska-devel mailing list