# Install FreeImage/ImageScience on Leopard

**URL:** <https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363>\
**Category:** Rails\
**Created:** [February 7, 2008, 2:31am UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363 "2008-02-07T02:31:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [February 7, 2008, 2:31am UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/1 "2008-02-07T02:31:05Z")

</div>

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 ‘’  
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

---

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [February 7, 2008, 3:20am UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/2 "2008-02-07T03:20:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [February 8, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/3 "2008-02-08T22:03:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [February 9, 2008, 6:19am UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/4 "2008-02-09T06:19:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [September 23, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/5 "2008-09-23T16:37:28Z")

</div>

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:

> 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

---

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [February 10, 2008, 7:42am UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/6 "2008-02-10T07:42:22Z")

</div>

Thanks Art - that fixed it.

-Angel

On Feb 9, 12:19 am, Brian A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![angelRamirez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/65b543/32.png) [@angelRamirez](https://www.ruby-forum.com/u/angelRamirez)\
**Post date:** [September 23, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/install-freeimage-imagescience-on-leopard/128363/7 "2008-09-23T16:39:03Z")

</div>

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

Bill Abel wrote:

> 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!
