Fix for amarok compile error on msvc

Vincent Castellano surye80 at gmail.com
Wed Dec 12 06:41:32 CET 2007


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amarok-msvcfix.patch
Type: application/octet-stream
Size: 600 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20071211/28d2fd49/attachment.obj 


More information about the Kde-windows mailing list