osx - Problems linking FreeImage 3.16.0 using make and Clang on Mac OS X 10.8 -


i've modified makefile.osx file comes freeimage 3.16.0 compile using clang , use latest 10.8 mac os x sdk, has gotten rid of of problems, i'm stuck on small set of linker errors can't find information on.

i modified makefile based off of recommendations of other post on stackoverflow: how compile freeimage on mac os x 10.8?

and looks like:

# -*- makefile -*- # mac osx makefile freeimage  # file can generated ./gensrclist.sh include makefile.srcs  # general configuration variables: cc_i386 = clang cc_x86_64 = clang cpp_i386 = clang++ cpp_x86_64 = clang++ compilerflags = -os -fexceptions -fvisibility=hidden -dno_lcms -d__ansi__ compilerflags_i386 = -arch i386 compilerflags_x86_64 = -arch x86_64 compilerppflags = -wno-ctor-dtor-privacy -d__ansi__ -stdlib=libc++ include +=  include_i386 = -isysroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk include_x86_64 = -isysroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk cflags_i386 = $(compilerflags) $(compilerflags_i386) $(include) $(include_i386) cflags_x86_64 = $(compilerflags) $(compilerflags_x86_64) $(include) $(include_x86_64) cppflags_i386 = $(compilerppflags) $(cflags_i386) cppflags_x86_64 = $(compilerppflags) $(cflags_x86_64) libraries_i386 = -wl,-syslibroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk libraries_x86_64 = -wl,-syslibroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.8.sdk libtool = libtool lipo = lipo  target = freeimage staticlib = lib$(target).a sharedlib = lib$(target)-$(ver_major).$(ver_minor).dylib libname = lib$(target).$(ver_major).dylib header = source/freeimage.h  .suffixes: .o-i386 .o-x86_64 modules_i386 = $(srcs:.c=.o-i386) modules_x86_64 = $(srcs:.c=.o-x86_64) modules_i386 := $(modules_i386:.cpp=.o-i386) modules_x86_64 := $(modules_x86_64:.cpp=.o-x86_64)  prefix = /usr/local installdir = $(prefix)/lib incdir = $(prefix)/include  default:  all: dist  dist: freeimage     cp *.a dist     cp *.dylib dist     cp source/freeimage.h dist  freeimage: $(staticlib) $(sharedlib)  $(staticlib): $(staticlib)-i386 $(staticlib)-x86_64     $(lipo) -create $(staticlib)-i386 $(staticlib)-x86_64 -output $(staticlib)  $(staticlib)-i386: $(modules_i386)     $(libtool) -arch_only i386 -o $@ $(modules_i386)  $(staticlib)-x86_64: $(modules_x86_64)     $(libtool) -arch_only x86_64 -o $@ $(modules_x86_64)  $(sharedlib): $(sharedlib)-i386 $(sharedlib)-x86_64     $(lipo) -create $(sharedlib)-i386 $(sharedlib)-x86_64 -output $(sharedlib)  $(sharedlib)-i386: $(modules_i386)     $(cpp_i386) -arch i386 -dynamiclib $(libraries_i386) -o $@ $(modules_i386)  $(sharedlib)-x86_64: $(modules_x86_64)     $(cpp_x86_64) -arch x86_64 -dynamiclib $(libraries_x86_64) -o $@ $(modules_x86_64)  .c.o-i386:     $(cc_i386) $(cflags_i386) -c $< -o $@  .c.o-x86_64:     $(cc_x86_64) $(cflags_x86_64) -c $< -o $@  .cpp.o-i386:     $(cpp_i386) $(cppflags_i386) -c $< -o $@  .cpp.o-x86_64:     $(cpp_x86_64) $(cppflags_x86_64) -c $< -o $@  install:     install -d -m 755 -o root -g wheel $(incdir) $(installdir)     install -m 644 -o root -g wheel $(header) $(incdir)     install -m 644 -o root -g wheel $(sharedlib) $(staticlib) $(installdir)     ranlib -sf $(installdir)/$(staticlib)     ln -sf $(sharedlib) $(installdir)/$(libname)  clean:     rm -f core dist/*.* u2dtmp* $(modules_i386) $(modules_x86_64) $(staticlib) $(staticlib)-i386 $(sharedlib) $(sharedlib)-i386 $(sharedlib)-x86_64 

the linker errors i'm getting in libjxr far can tell:

undefined symbols architecture i386:   "_perftimercopystarttime", referenced from:       _imagestrdecinit in strdec.o-i386       _imagestrencinit in strenc.o-i386   "_perftimerdelete", referenced from:       _imagestrdecterm in strdec.o-i386       _imagestrencterm in strenc.o-i386   "_perftimergetresults", referenced from:       _outputindivperftimer in strcodec.o-i386   "_perftimernew", referenced from:       _imagestrdecinit in strdec.o-i386       _imagestrencinit in strenc.o-i386   "_perftimerstart", referenced from:       _imagestrdecinit in strdec.o-i386       _imagestrdecdecode in strdec.o-i386       _imagestrdecterm in strdec.o-i386       _imagestrencinit in strenc.o-i386       _imagestrencencode in strenc.o-i386       _imagestrencterm in strenc.o-i386       _readis in strcodec.o-i386       ...   "_perftimerstop", referenced from:       _imagestrdecinit in strdec.o-i386       _imagestrdecdecode in strdec.o-i386       _imagestrdecterm in strdec.o-i386       _imagestrencinit in strenc.o-i386       _imagestrencencode in strenc.o-i386       _imagestrencterm in strenc.o-i386       _readis in strcodec.o-i386 

i have no idea try fix this, since it's happening i386 configuration, x86_64 configuration seems linking fine.

if don't need libjxr performance timers, can disable them. change line in makefile:

compilerflags = -os -fexceptions -fvisibility=hidden -dno_lcms -d__ansi__ 

to:

compilerflags = -os -fexceptions -fvisibility=hidden -dno_lcms -d__ansi__ -ddisable_perf_measurement 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -