Bug #1066
Unable to build for Mac OSX 10.6
100%
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
Related issues
Associated revisions
#1066. Fixed compiler warning on MacOS-X 10.6 on ppc. Signed/unsigned mismatch.
History
Updated by Thomas Beutlich over 6 years ago
- File T1066.patch T1066.patch added
A simple patch T1066.patch that removes the unique_ptr
and uses (previously unused) str
is attached.
Updated by Thomas Beutlich over 6 years ago
- File T1066.patch T1066.patch added
Still improving: Use tail controlled loop and have the delete[]
at one place only. Also remove include of memory.
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 2I'll look again at this tomorrow.
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
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.
Updated by Robin Mills over 6 years ago
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 = 1I'm going to have my breakfast and then investigate/fix the test exception.
I'm hope today will be less stressful.
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)
#1066 Thank You, Thomas for the patch.
1066 = The Battle of Hastings