Project

General

Profile

Bug #408

0.6.1 does not build on OS X

Added by Thomas Lunde almost 17 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Category:
build
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Downloaded 0.6.1 tarball & uncompressed. cd into it, ./configure, then make. After a number of warning messages (see today's other issue), the compilation failed with:

g++ canonmn.so datasets.so exif.so fujimn.so ifd.so image.so iptc.so makernote.so metadatum.so nikonmn.so sigmamn.so tags.so types.so value.so -shared -fPIC -o libexiv2.so
g++: unrecognized option `-shared'
ld: Undefined symbols:
_main
make1: * [libexiv2.so] Error 1
make: *
[all] Error 2
white:~/Desktop/exiv2-0.6.1 tlunde$

Additional information:

Perhaps this is useful:

white:~/Desktop/exiv2-0.6.1 tlunde$ g++ --version
g++ (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

white:~/Desktop/exiv2-0.6.1 tlunde$

History

#1

Updated by Thomas Lunde almost 17 years ago

Shared libraries are different on OS X than many other flavors of unix. Here are couple of references on how others dealt with this:

http://www.octave.org/octave-lists/archive/octave-maintainers.2004/msg00198.html
(reporting success with a shared library build; the configure script for octave should have the relevant options)

http://lists.gnu.org/archive/html/help-gsl/2004-12/msg00007.html
(reporting a method to force static usage on OS X)

http://www.digitalmars.com/d/archives/D/gnu/906.html

http://www.lsc-group.phys.uwm.edu/pipermail/lal-discuss/2003q3/002673.html

http://lists.gnu.org/archive/html/bug-gmp/2002-10/msg00013.html (this is dated info; it was as of OS X 10.2 and I'm running 10.3; the shared lib situation has somewhat improved)

#2

Updated by Thomas Lunde almost 17 years ago

Forcing a static build by manually changing config.mk (after running ./configure) to read:
SHARED_LIBS =
STATIC_LIBS = 1

instead of the

SHARED_LIBS = 1
STATIC_LIBS =

which configure produces does allow the build to complete & appears to create usable binaries (although obviously at the cost of memory, diskspace, etc.).

Sorry that my gnu-auto* fu isn't good enough to know how to appropriately patch the autoconf stuff.

#3

Updated by Thomas Lunde almost 17 years ago

Using one of the suggestions in the links and replacing:
LDFLAGS_SHARED = $(LDFLAGS) -shared -fPIC
with
LDFLAGS_SHARED = $(LDFLAGS) -flat_namespace -undefined suppress -bundle -fPIC

in config.mk allows the build to get farther, but it stops with:

g++ -Wall -O2 addmoddel.o -L. -L/usr/local/lib -lexiv2 -o addmoddel
ld: can't locate file for: -lexiv2
make1: * [addmoddel] Error 1
make: *
[all] Error 2

#4

Updated by Andreas Huggel almost 17 years ago

The fix for this and all similar problems on other platforms is to use libtool in the build process.

http://www.gnu.org/software/libtool/libtool.html

#5

Updated by Andreas Huggel over 16 years ago

r517, 520 (branches/Exiv2-0_6_041212)
r534 (trunk)

Also available in: Atom PDF