Project

General

Profile

Bug #1066

Unable to build for Mac OSX 10.6

Added by Max Pozdeev over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build
Target version:
Start date:
25 Apr 2015
Due date:
% Done:

100%

Estimated time:

Description

I can not build the library from latest revision (r3730) for the Mac OSX 10.6.
I'm using a Mac with OSX 10.10 64bit, so I put the line "-stdlib=libstdc++ -mmacosx-version-min=10.6" into CPPFLAGS, LDFLAGS, etc.
The error is missing std::unique_ptr:

tiffimage.cpp:347:8: error: no member named 'unique_ptr' in namespace 'std'
                std::unique_ptr<char[]> formatted;
                ~~~~~^
...
1 warning and 6 errors generated.

The fix is to use alternate C++ library, i.e "-stdlib=libc++ -mmacosx-version-min=10.7". But it available only for OSX 10.7+. So I can not use Deployment Targets lower that 10.7.


Files

T1066.patch (1.07 KB) T1066.patch Thomas Beutlich, 25 Apr 2015 21:48
T1066.patch (1.17 KB) T1066.patch Thomas Beutlich, 25 Apr 2015 21:56
T1066.patch (1.37 KB) T1066.patch Thomas Beutlich, 25 Apr 2015 22:11

Related issues

Related to Exiv2 - Bug #1065: Is fileProtocol() thread-safe?Closed25 Apr 2015

Actions

Associated revisions

Revision 3735 (diff)
Added by Robin Mills over 6 years ago

#1066 Thank You, Thomas for the patch.

1066 = The Battle of Hastings

Revision 3736 (diff)
Added by Robin Mills over 6 years ago

#1066. Fixed compiler warning on MacOS-X 10.6 on ppc. Signed/unsigned mismatch.

Revision 3737 (diff)
Added by Robin Mills over 6 years ago

#1066. Fix for test exception. It's coming from #922 on all platforms except Mac.

History

#1

Updated by Thomas Beutlich over 6 years ago

A simple patch T1066.patch that removes the unique_ptr and uses (previously unused) str is attached.

#2

Updated by Thomas Beutlich over 6 years ago

Fixed the patch.

#3

Updated by Thomas Beutlich over 6 years ago

Still improving: Use tail controlled loop and have the delete[] at one place only. Also remove include of memory.

#4

Updated by Robin Mills over 6 years ago

  • Category set to build
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Target version set to 0.25

Thanks Thomas. I applied your patch. Here's my effort to build it:

$ env MACOSX_DEPLOYMENT_TARGET=10.6 make rebuild ; exiv2 -vV -g date -g time -t svn
...
  "vtable for std::basic_streambuf<char, std::char_traits<char> >", referenced from:
      (anonymous namespace)::parseCommonTargets(std::string const&, std::string const&) in exiv2.o
      std::string Exiv2::toString<int>(int const&) in exiv2.o
      std::basic_string<char, std::char_traits<char>, std::allocator<char> > Exiv2::toBasicString<char, std::string>(std::string const&) in exiv2.o
      int Exiv2::stringTo<int>(std::string const&, bool&) in exiv2.o
      Action::Print::printMetadatum(Exiv2::Metadatum const&, Exiv2::Image const*) in actions.o
      Action::Adjust::adjustDateTime(Exiv2::ExifData&, std::string const&, std::string const&) const in actions.o
      Action::FixIso::run(std::string const&) in actions.o
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >", referenced from:
      (anonymous namespace)::parseCommonTargets(std::string const&, std::string const&) in exiv2.o
      std::string Exiv2::toString<int>(int const&) in exiv2.o
      std::basic_string<char, std::char_traits<char>, std::allocator<char> > Exiv2::toBasicString<char, std::string>(std::string const&) in exiv2.o
      int Exiv2::stringTo<int>(std::string const&, bool&) in exiv2.o
      Action::Print::printMetadatum(Exiv2::Metadatum const&, Exiv2::Image const*) in actions.o
      Action::Adjust::adjustDateTime(Exiv2::ExifData&, std::string const&, std::string const&) const in actions.o
      Action::FixIso::run(std::string const&) in actions.o
      ...
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [exiv2] Error 1
make: *** [install] Error 2
make: *** [rebuild] Error 2
I'll look again at this tomorrow.

#5

Updated by Niels Kristian Bech Jensen over 6 years ago

Thomas' patch fixes the build error I had on Ubuntu 14.04 and 15.04 (no unique_ptr in namespace std).

Best regards,
Niels Kristian Bech Jensen

#6

Updated by Max Pozdeev over 6 years ago

Third patch fixes the error. Thank you, Thomas!

Just for info. Only one warning is present:

tiffimage.cpp:442:26: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if ( nMaxLength > sizeof(buffer) )
                     ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
1 warning generated.

#7

Updated by Robin Mills over 6 years ago

Submitted Thomas' patch. r3735. Thank You, Thomas for the patch.

I still get the build error I reported above on 10.6 and 10.7. I haven't tried 10.8 or 10.9. However as Max is happy with Thomas' patch, I have submitted it.

I fixed int/size_t nMaxLength > sizeof(buffer) last night on r3732

#8

Updated by Robin Mills over 6 years ago

r3735 has successfully build and passed the test suite on MacOS-X. http://exiv2.dyndns.org:8080/job/Exiv2-trunk/1964/

A small test exception is being reported on MSVC/Cygwin/Linux/MinGW:

Running bugfixes-test.sh ...
426 440 443 444 445 447 452 460 479 480 495 498 501 528 540 554 662 666 683 711 726 751 769 784 799 800 812 831 (836 skipped) 841 876 884 922 937 937a 1026 1040 1043 1044 1053 1054 1058 1062 
Files /c/Users/Shared/workspace/Exiv2-trunk/label/mingw/test/tmp/bugfixes-test.out-stripped and /c/Users/Shared/workspace/Exiv2-trunk/label/mingw/test/data/bugfixes-test.out differ
1490c1490
<       9      16 1677414
---
>        9      16 1677405
result = 1 
I'm going to have my breakfast and then investigate/fix the test exception.

I'm hope today will be less stressful.

#9

Updated by Max Pozdeev over 6 years ago

I've missed r3732. Thank you.

I've just tested r3735 to build on OSX 10.6.8 64bit machine with Xcode 3.2.6 - it's ok.
Only one warning for i386 arch:

tiffimage.cpp: In member function ‘virtual void Exiv2::TiffImage::printStructure(std::ostream&, Exiv2::printStructureOption_e)’:
tiffimage.cpp:509: warning: comparison between signed and unsigned integer expressions

 g++ -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

#10

Updated by Robin Mills over 6 years ago

I've fixed that. r3736.

#11

Updated by Robin Mills over 6 years ago

  • Status changed from Assigned to Resolved
#12

Updated by Robin Mills over 6 years ago

  • % Done changed from 0 to 100
#13

Updated by Andreas Huggel over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF