Install FreeImage/ImageScience on Leopard

Hello -

I am trying to install FreeImage on OSX 10.5 and am having trouble. I
have tried both via mac ports as well as source install and can't get
it to work. Also, I have installed dev sdk tools from the Leopard
disc, and see them in my HD 10.4u and 10.5. I have checked out
several posts and have tried several fixes but to no avail. I am at
my wits end and wondering if anyone can notice what I may be doing
wrong.

Any help greatly appreciated.

Thanks,
Angel

Here are some clippets -
Port attempt:

s-macbook:FreeImage --$ sudo port install freeimage
Password:
---> Building freeimage with target all
Error: Target org.macports.build returned: shell command " cd "/opt/
local/var/macports/build/
_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_freeimage/
work/FreeImage" && make all " returned error 2
Command output: Source/FreeImage/BitmapAccess.cpp:896: error: expected
`;' before 'TAGMAP'
Source/FreeImage/BitmapAccess.cpp:904: error: 'strcmp' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:908: error: 'FreeImage_GetTagCount'
was not declared in this scope
Source/FreeImage/BitmapAccess.cpp:908: error: 'WORD' was not declared
in this scope
Source/FreeImage/BitmapAccess.cpp:908: error: 'FreeImage_TagDataWidth'
cannot be used as a function
Source/FreeImage/BitmapAccess.cpp:908: error: 'FreeImage_GetTagLength'
was not declared in this scope
Source/FreeImage/BitmapAccess.cpp:922: error: 'WORD' was not declared
in this scope
Source/FreeImage/BitmapAccess.cpp:941: error: 'TAGMAP' is not a class
or namespace
Source/FreeImage/BitmapAccess.cpp:941: error: 'iterator' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:941: error: expected `;' before 'i'
Source/FreeImage/BitmapAccess.cpp:942: error: 'i' was not declared in
this scope
Source/FreeImage/BitmapAccess.cpp:952: error: 'TAGMAP' is not a class
or namespace
Source/FreeImage/BitmapAccess.cpp:952: error: 'iterator' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:952: error: expected `;' before 'i'
Source/FreeImage/BitmapAccess.cpp:952: error: 'i' was not declared in
this scope
Source/FreeImage/BitmapAccess.cpp:957: error: type '<type error>'
argument given to 'delete', expected pointer
Source/FreeImage/BitmapAccess.cpp: In function 'BOOL
FreeImage_GetMetadata(FREE_IMAGE_MDMODEL, FIBITMAP*, const char*,
FITAG**)':
Source/FreeImage/BitmapAccess.cpp:970: error: 'TAGMAP' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:970: error: 'tagmap' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:974: error: 'METADATAMAP' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:974: error: 'metadata' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:974: error: 'struct FREEIMAGEHEADER'
has no member named 'metadata'
Source/FreeImage/BitmapAccess.cpp: In function 'unsigned int
FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL, FIBITMAP*)':
Source/FreeImage/BitmapAccess.cpp:995: error: 'TAGMAP' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:995: error: 'tagmap' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:998: error: 'METADATAMAP' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:998: error: 'metadata' was not
declared in this scope
Source/FreeImage/BitmapAccess.cpp:998: error: 'struct FREEIMAGEHEADER'
has no member named 'metadata'
make[1]: *** [Source/FreeImage/BitmapAccess.o-ppc] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.
s-macbook:FreeImage --$

Source attempt:

s-macbook:FreeImage --$ make
make -f Makefile.osx
g++-4.0 -Wno-ctor-dtor-privacy -Os -fexceptions -fvisibility=hidden -
arch ppc -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -
ISource/LibJPEG -ISource/LibMNG -ISource/LibPNG -ISource/LibTIFF -
ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/
Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/
IlmThread -ISource/OpenEXR/Imath -isysroot /Developer/SDKs/
MacOSX10.3.9.sdk -c Source/FreeImage/BitmapAccess.cpp -o Source/
FreeImage/BitmapAccess.o-ppc
Source/FreeImage/BitmapAccess.cpp:30:20: error: stdlib.h: No such file
or directory
In file included from Source/FreeImage/BitmapAccess.cpp:35:
Source/FreeImage.h:55:51: error: wchar.h: No such file or directory
Source/FreeImage.h:152:22: error: inttypes.h: No such file or
directory
In file included from Source/FreeImage/BitmapAccess.cpp:37:
Source/Utilities.h:31:18: error: math.h: No such file or directory
Source/Utilities.h:33:20: error: memory.h: No such file or directory
Source/Utilities.h:34:19: error: stdio.h: No such file or directory
Source/Utilities.h:35:20: error: string.h: No such file or directory
Source/Utilities.h:36:20: error: stdarg.h: No such file or directory
Source/Utilities.h:37:19: error: ctype.h: No such file or directory
Source/Utilities.h:38:20: error: assert.h: No such file or directory
Source/Utilities.h:40:18: error: string: No such file or directory
Source/Utilities.h:41:16: error: list: No such file or directory
Source/Utilities.h:42:15: error: map: No such file or directory
Source/Utilities.h:43:15: error: set: No such file or directory
Source/Utilities.h:44:18: error: vector: No such file or directory
Source/Utilities.h:45:17: error: stack: No such file or directory
Source/Utilities.h:46:19: error: sstream: No such file or directory
Source/Utilities.h:47:21: error: algorithm: No such file or directory
....and many more lines of errors
...
...
Source/FreeImage/BitmapAccess.cpp:998: error: 'struct FREEIMAGEHEADER'
has no member named 'metadata'
make[1]: *** [Source/FreeImage/BitmapAccess.o-ppc] Error 1
make: *** [default] Error 2

BTW - here's my error when trying out my app:

error executing cc -arch ppc -arch i386 -pipe -bundle -I/opt/local/
include -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -I /
System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/
universal-darwin9.0 -I /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/include -o "/Users/--/testapp/.ruby_inline/
Inline_ImageScience_aa58.bundle" "/Users/--/testapp/.ruby_inline/
Inline_ImageScience_aa58.c" -L/opt/local/lib -lfreeimage -lstdc++ -
flat_namespace -undefined suppress: 256
Renamed /Users/--/testapp/.ruby_inline/Inline_ImageScience_aa58.c to /
Users/--/testapp/.ruby_inline/Inline_ImageScience_aa58.c.bad

It's an easy fix. The FreeImage make.osx file refers to older Mac
sdks. Open up that file and make sure the following lines are exactly
as I have them listed:

INCLUDE_PPC = -isysroot /Developer/SDKs/MacOSX10.5.sdk
INCLUDE_I386 = -isysroot /Developer/SDKs/MacOSX10.5.sdk
...
LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.5.sdk
LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.5.sdk

then do a make followed by a sudo make intall and all should work
fine.

-Art

Wow, Art that worked. Been trying to figure that out for the last 4
hours! Thank you!!

Thanks Art - that fixed it.

-Angel

How would someone know where these libraries are and how to reference
them. I was clever enough to notice that the library referenced didn't
match the one I had installed, but I have no idea how you knew to change
"INCLUDE_PPC" to "LIBRARIES_PPC", etc. Also, I have not SDKs directory
in /Developer. How do you know to refer to it this way?

By the way, this did work on my G5 PPC with OX 10.3.9 - thanks for the
help!

FlyBoyArt wrote:

Correction. I meant it worked on OS X 10.4.11 (PPC G5)

Bill Abel wrote: