Fix for amarok compile error on msvc
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Wed Dec 12 07:02:46 CET 2007
Vincent Castellano schrieb:
> When using the emerge build tool chain with msvc2005, amarok build
> fails as follows:
>
> [ 1%] Building CXX object
> src/metadata/CMakeFiles/amarok_taglib.dir/m4a/mp4file.obj
> mp4file.cpp
> c:\kderoot\tmp\amarok-2.0.20071121\work\amarok\src\metadata\m4a\mp4itunestag.h(64)
> : warning C4301: 'TagLib::MP4::Tag::setYear': overriding virtual
> function only differs from 'TagLib::Tag::setYear' by const/volatile
> qualifier
> c:\kderoot\include\taglib\tag.h(130) : see declaration of
> 'TagLib::Tag::setYear'
> c:\kderoot\tmp\amarok-2.0.20071121\work\amarok\src\metadata\m4a\mp4itunestag.h(65)
> : warning C4301: 'TagLib::MP4::Tag::setTrack': overriding virtual
> function only differs from 'TagLib::Tag::setTrack' by const/volatile
> qualifier
> c:\kderoot\include\taglib\tag.h(135) : see declaration of
> 'TagLib::Tag::setTrack'
> C:\kderoot\tmp\amarok-2.0.20071121\work\amarok\src\metadata\m4a\mp4file.cpp(48):
> error C2259: 'TagLib::MP4::Tag' : cannot instantiate abstract class
> due to following members:
> 'void TagLib::Tag::setYear(TagLib::uint)' : is abstract
> c:\kderoot\include\taglib\tag.h(130) : see declaration of
> 'TagLib::Tag::setYear'
> 'void TagLib::Tag::setTrack(TagLib::uint)' : is abstract
> c:\kderoot\include\taglib\tag.h(135) : see declaration of
> 'TagLib::Tag::setTrack'
>
> The problem was in amarok\src\metadata\m4a\mp4itunestag.h in which two
> functions (setYear(uint) and setTrack(uint)) were declared as having
> const parameters. My guess is they were declared const just for
> consistency with the other String based calls, or maybe it serves some
> other function I am unaware of. However, msvc2005 differentiates const
> parameters from non-const, and there for the base class still has
> unimplemented pure virtual functions, as discussed in
> http://msdn2.microsoft.com/en-us/library/bby1ahfc(VS.80).aspx
>
> A patch is attached to show what I mean.
>
Please send it to amarok-devel because it's an amarok problem. It's also
wrong on mingw/gcc and nothing msvc specific. in kdelibs we introduced
"-Woverloaded-virtual" for gcc to find such errors.
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20071212/fb280c8a/attachment.pgp
More information about the Kde-windows
mailing list