[mythtv] android compile problems

Peter Bennett pb.mythtv at gmail.com
Mon Jun 8 22:50:00 UTC 2020

On 6/8/20 1:20 PM, Peter Bennett wrote:
> On 6/8/20 12:42 PM, David Hampton wrote:
>> On Mon, 2020-06-08 at 12:07 -0400, Peter Bennett wrote:
>>> Hi David
>>> Compiling fixes/31 for android 64 bit I am getting the following
>>> errors
>>> imagemetadata.cpp:281:19: error: no type named 'AutoPtr' in
>>> 'Exiv2::Image'
>>>       Exiv2::Image::AutoPtr m_image;
>>>       ~~~~~~~~~~~~~~^
>>> I see you added the following comment:
>>> // Clang8 warns that 'AutoPtr' is deprecated. It was apparently
>>> // deprecated in glibc-2.27, and the exiv2 library hasn't been
>>> // updated yet.
>>> Exiv2::Image::AutoPtr m_image;
>>> Perhaps the exiv2 library has now been updated? Do you know more
>>> about what is going on here?
>> Hi Peter,
>> The MythTV master branch was updated to use an embedded copy of exiv2
>> git on March 15th (commit 2807de0a74) so that using a c++17 compiler
>> would work.  C++17 dropped the AutoPtr type.   Android was also updated
>> on Mar 23 (commit f3c1cd0408) to build exiv2 from git so that it could
>> build using c++17 and master.
>> What you're running into appears to be trying to compile fixes/31,
>> which expects the old pre-c++17 exiv2-0.25 library, using the newer
>> c++17 clean exiv2-git library.
>>> The other error is
>>> imagemetadata.cpp:704:10: error: cannot initialize return object of
>>> type
>>> 'ImageMetaData *' with an rvalue of type 'PictureMetaData *'
>>> { return new PictureMetaData(filePath); }
>>>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> Perhaps this needs to be changed to some sort of <cast> syntax. Old
>>> style cast no longer working? Don't know why this errors for android
>>> but not for linux.
>> This is probably a side effect of the first problem.  The
>> PictureMetaData object contains an Exiv2::Image::AutoPtr, which doesn't
>> exist when compiling against the git version of exiv2.
>> David
> Thanks for the info.
> Probably this happened because my makelibs was run under master but 
> the mythbuild was run with fixes/31. So I maybe need to run makelibs 
> again with v31 of the packaging repository, or at least the exiv2 part 
> of makelibs.
> Peter
That did not solve it. It seems the android V31 build now needs 
UniquePtr. (master already uses UniquePtr). This is when building on 
Ubuntu 20.04. The following code works to successfully build v31 for 
both Linux and Android:

#ifdef ANDROID
     Exiv2::Image::UniquePtr m_image;
     Exiv2::Image::AutoPtr m_image;

Is this OK? I would have preferred some sort of "#if 
there-exists_type_AutoPtr" rather than the android test, but I don't 
think there is an easy way to do that


More information about the mythtv-dev mailing list