<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>exploration &#187; development</title>
	<atom:link href="http://robertcarlsen.net/tag/development/feed" rel="self" type="application/rss+xml" />
	<link>http://robertcarlsen.net</link>
	<description>accounts of success and misadventure</description>
	<lastBuildDate>Tue, 13 Jul 2010 14:37:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sinatra + Kara == qwerty animals</title>
		<link>http://robertcarlsen.net/2010/02/20/sinatra-kara-qwerty-animals-1108</link>
		<comments>http://robertcarlsen.net/2010/02/20/sinatra-kara-qwerty-animals-1108#comments</comments>
		<pubDate>Sat, 20 Feb 2010 16:53:49 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[itp]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[couchrest]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[funaday]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[kara]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[qwerty]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1108</guid>
		<description><![CDATA[Yesterday I released a small web app; it was my first using the Sinatra microframework for Ruby: http://qwerty.robertcarlsen.net

The app arranges illustrations of animals wearing lettered t-shirts to create user-supplied messages. Kara Schlindwein created the illustrations as part of her project for the 6th Annual Fun-a-Day project in Philadelphia, and I wrote the first draft of the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I released a small web app; it was my first using the <a href="http://www.sinatrarb.com/" onclick="pageTracker._trackPageview('/outgoing/www.sinatrarb.com/?referer=');">Sinatra</a> microframework for Ruby: <a href="http://qwerty.robertcarlsen.net" onclick="pageTracker._trackPageview('/outgoing/qwerty.robertcarlsen.net?referer=');">http://qwerty.robertcarlsen.net</a></p>
<p style="text-align: center;"><a href="http://robertcarlsen.net/blog/wp-content/uploads/2010/02/sinatra.png" rel="lightbox[1108]"><img class="size-medium wp-image-1109 aligncenter" title="sinatra" src="http://robertcarlsen.net/blog/wp-content/uploads/2010/02/sinatra-300x72.png" alt="sinatra" width="300" height="72" /></a></p>
<p>The app arranges illustrations of animals wearing lettered t-shirts to create user-supplied messages. <a href="http://karaschlindwein.com/qwerty_animals.php" onclick="pageTracker._trackPageview('/outgoing/karaschlindwein.com/qwerty_animals.php?referer=');">Kara Schlindwein</a> created the illustrations as part of her project for the 6th Annual <a href="http://artclash.com/" onclick="pageTracker._trackPageview('/outgoing/artclash.com/?referer=');">Fun-a-Day</a> project in Philadelphia, and I wrote the first draft of the app while sitting in a chair at the show a couple of weeks ago, still nursing my broken ankle.<span id="more-1108"></span></p>
<p>I&#8217;ve come to really like working with Sinatra / HAML / SASS – once I had a basic comprehension of how the components fit together I could see how to organize the app without getting mired in the code. Making changes to the app has been pleasantly easy. Deployment via <a href="http://www.modrails.com/" onclick="pageTracker._trackPageview('/outgoing/www.modrails.com/?referer=');">Passenger</a> (mod_rails) on Apache was simple enough my my local and development servers (after reading sample virtual host configurations) and setting up a subdomain on <a href="http://blog.nyerm.com/2009/03/21/deploying-a-sinatra-app-on-dreamhost/" onclick="pageTracker._trackPageview('/outgoing/blog.nyerm.com/2009/03/21/deploying-a-sinatra-app-on-dreamhost/?referer=');">Dreamhost</a> has been fine, too. Everything is coordinated via git, so pushing changes around has been simple.</p>
<p>I first heard about Sinatra (and couchdb for that matter) in a presentation by <a href="http://danieltsadok.wordpress.com/2009/03/26/its-all-middleware/" onclick="pageTracker._trackPageview('/outgoing/danieltsadok.wordpress.com/2009/03/26/its-all-middleware/?referer=');">Daniel Tsadock </a>at ITP last year and I&#8217;ve kept it in the back of my mind as something I wanted to try. I&#8217;m just now getting to development of my thesis project website and decided to use Sinatra for it, although I had a disappointing experience with the performance of another Sinatra + couchrest app I wrote for the Live Experimental Interactive Television class this past week. My VPS development server ground to a halt when a dozen classmates attempted to use the app at the same time. I&#8217;m pretty sure that my code was somewhat inefficient (with each client polling couchdb through an api provided via Sinatra routes), however I was hoping for usability beyond 12 simultaneous connections. I&#8217;m still optimistic though that it will work, and writing an app with the framework and view templates is fast and actually pretty fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2010/02/20/sinatra-kara-qwerty-animals-1108/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OCR on iPhone demo</title>
		<link>http://robertcarlsen.net/2009/12/06/ocr-on-iphone-demo-1043</link>
		<comments>http://robertcarlsen.net/2009/12/06/ocr-on-iphone-demo-1043#comments</comments>
		<pubDate>Sun, 06 Dec 2009 20:33:39 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tesseract]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1043</guid>
		<description><![CDATA[Update: Source code for demo project released.

i finally got around to building a proof of concept implementation of tesseract-ocr for the iPhone. months ago, i documented the steps which helped to get the library cross-compiled for the iPhone&#8217;s ARM processor, and how to build a fat library for use with the simulator as well. several [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: Source code for demo project <a href="http://robertcarlsen.net/2010/01/12/ocr-for-iphone-source-1080">released</a>.</p>
<p><img class="size-full wp-image-1051 alignright" title="TessIcon" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/12/TessIcon.png" alt="TessIcon" width="57" height="57" /></p>
<p>i finally got around to building a proof of concept implementation of <a href="http://code.google.com/p/tesseract-ocr/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/tesseract-ocr/?referer=');">tesseract-ocr</a> for the iPhone. months ago, i <a href="http://robertcarlsen.net/2009/07/15/cross-compiling-for-iphone-dev-884">documented</a> the steps which helped to get the library cross-compiled for the iPhone&#8217;s ARM processor, and how to build a fat library for use with the simulator as well. several folks have helped immensely in noting how to actually run the engine in obj-c++. thanks to everyone who has commented so far.</p>
<p>anyway, below is a short video of the POC in action. the basic workflow is: select image from photo library or camera, crop tightly on the box of text you&#8217;d like to convert, wait while it processes, select / copy or email text.<span id="more-1043"></span></p>
<p>there are loads of improvements which could be implemented (image histogram adjustment, rotation / perspective correction, automatic text box/layout detection, content detection &#8211; dates, links, contact information&#8230;) but this is a nice point to stop and document.</p>
<p>i realize that there are several OCR applications available for the iPhone, including a few which also run the engine on the device rather than handing it off to a web service. this started as an educational project on cross-compiling, and to fill a personal want for a handheld OCR app of my own. for these reasons, i&#8217;m going to open-source the entire app. look for it after this semester ends when i&#8217;ll have some more time to properly document the code. in the meantime, enjoy these code snippets demonstrating how to initialize the engine and process an image.</p>
<p>Initialize the engine:</p>
<pre class="brush: cpp;">
    NSString *dataPath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:@&quot;tessdata&quot;];
    /*
     Set up the data in the docs dir
     want to copy the data to the documents folder if it doesn't already exist
     */
    NSFileManager *fileManager = [NSFileManager defaultManager];
    // If the expected store doesn't exist, copy the default store.
    if (![fileManager fileExistsAtPath:dataPath]) {
        // get the path to the app bundle (with the tessdata dir)
        NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
        NSString *tessdataPath = [bundlePath stringByAppendingPathComponent:@&quot;tessdata&quot;];
        if (tessdataPath) {
            [fileManager copyItemAtPath:tessdataPath toPath:dataPath error:NULL];
        }
    }

    NSString *dataPathWithSlash = [[self applicationDocumentsDirectory] stringByAppendingString:@&quot;/&quot;];
    setenv(&quot;TESSDATA_PREFIX&quot;, [dataPathWithSlash UTF8String], 1);

    // init the tesseract engine.
    tess = new TessBaseAPI();

    tess-&gt;SimpleInit([dataPath cStringUsingEncoding:NSUTF8StringEncoding],  // Path to tessdata-no ending /.
                     &quot;eng&quot;,  // ISO 639-3 string or NULL.
                     false);
</pre>
<p>Process an image. This should be threaded as it&#8217;s a heavy process:</p>
<pre class="brush: cpp;">
    CGSize imageSize = [uiImage size];
    double bytes_per_line	= CGImageGetBytesPerRow([uiImage CGImage]);
    double bytes_per_pixel	= CGImageGetBitsPerPixel([uiImage CGImage]) / 8.0;

    CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider([uiImage CGImage]));
    const UInt8 *imageData = CFDataGetBytePtr(data);

    // this could take a while. maybe needs to happen asynchronously.
    char* text = tess-&gt;TesseractRect(imageData,
                                     bytes_per_pixel,
                                     bytes_per_line,
                                     0, 0,
                                     imageSize.width, imageSize.height);

    // Do something useful with the text!
    NSLog(@&quot;Converted text: %@&quot;,[NSString stringWithCString:text encoding:NSUTF8StringEncoding]);

    delete[] text;
</pre>
<p>Enjoy the video!<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/MICew5-nZp4&#038;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://www.youtube.com/v/MICew5-nZp4&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2009/12/06/ocr-on-iphone-demo-1043/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>coda</title>
		<link>http://robertcarlsen.net/2009/06/19/coda-846</link>
		<comments>http://robertcarlsen.net/2009/06/19/coda-846#comments</comments>
		<pubDate>Fri, 19 Jun 2009 13:28:52 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coda]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/blog/2009/06/19/coda-846</guid>
		<description><![CDATA[i recently switched to Coda for web development. now, i don&#8217;t do much web dev any longer&#8230;mostly for myself (as evidenced my this latest overhaul of robertcarlsen.net &#8211; which amounts to theme hacking, really). i never had a problem with tabbing through several programs to get the job done, but i like Panic&#8217;s style.
the interface [...]]]></description>
			<content:encoded><![CDATA[<p>i recently switched to Coda for web development. now, i don&#8217;t do much web dev any longer&#8230;mostly for myself (as evidenced my this latest overhaul of robertcarlsen.net &#8211; which amounts to theme hacking, really). i never had a problem with tabbing through several programs to get the job done, but i like Panic&#8217;s style.</p>
<p>the interface is clean and with keyboard shortcuts for each of the view modes. i do so wish for more info in the files panel&#8230;.i&#8217;m used to comparing modification times and the sync features of full-fledged FTP clients.</p>
<p>anyway, it&#8217;s good software – and i&#8217;ve come to really appreciate good software lately after writing a lot of bad software myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2009/06/19/coda-846/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[my] summer of code</title>
		<link>http://robertcarlsen.net/2009/05/22/my-summer-of-code-753</link>
		<comments>http://robertcarlsen.net/2009/05/22/my-summer-of-code-753#comments</comments>
		<pubDate>Fri, 22 May 2009 18:54:09 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cloud reader]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[follower]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[pinwheel]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shifd]]></category>
		<category><![CDATA[slide]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/blog/?p=753</guid>
		<description><![CDATA[In preparation for several iPhone application development gigs which have lined up for the summer I&#8217;m getting back into my previous projects. Specifically, I&#8217;m going to get Follower and Pinwheel ready for release and am looking to push them out to the AppStore in the next month or so.
Also, as an exercise to get working [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-754" title="icon" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/05/icon.png" alt="icon" width="57" height="57" />In preparation for several iPhone application development gigs which have lined up for the summer I&#8217;m getting back into my previous projects. Specifically, I&#8217;m going to get <a href="http://robertcarlsen.net/blog/2009/01/12/my-first-iphone-app-276">Follower</a> and <a href="http://robertcarlsen.net/blog/2009/01/14/pinwheel-pinwheelspinning-around-293">Pinwheel</a> ready for release and am looking to push them out to the AppStore in the next month or so.</p>
<p>Also, as an exercise to get working with a web API I&#8217;m building an iPhone native client for <a href="http://shifd.com" onclick="pageTracker._trackPageview('/outgoing/shifd.com?referer=');">SHIFD</a>, called <a href="http://robertcarlsen.net/slide/">Slide</a>. Right now it&#8217;s overly simplistic, but I much prefer the native app to the mobile web app. I&#8217;m not sure if I&#8217;m going to keep it as a learning project or also invest the time and resources to make it another released application.</p>
<p>All this is in service to building out <a href="http://cloudreader.me" onclick="pageTracker._trackPageview('/outgoing/cloudreader.me?referer=');">cloudreader.me</a>, the online version of the <a href="http://robertcarlsen.net/blog/readr">CloudReader</a> generative text animation project. I&#8217;d like to make that something available sometime.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2009/05/22/my-summer-of-code-753/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>openFrameworks + iPhone libs</title>
		<link>http://robertcarlsen.net/2009/03/25/openframeworks-iphone-libs-593</link>
		<comments>http://robertcarlsen.net/2009/03/25/openframeworks-iphone-libs-593#comments</comments>
		<pubDate>Thu, 26 Mar 2009 04:09:19 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[lib]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[makefile]]></category>
		<category><![CDATA[openframeworks]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/blog/?p=593</guid>
		<description><![CDATA[I&#8217;ve had a few days to test the libraries I cobbled together for using openFrameworks with iPhone and also received positive reports from some folks who tried out the Makefiles I provided to them, so here they are for anyone who&#8217;s willing to try them out. -please make these instructions better if you see fit- [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/of_iphone.png" rel="lightbox[593]"><img class="alignright size-full wp-image-604" title="of_iphone" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/of_iphone.png" alt="of_iphone" width="123" height="119" /></a>I&#8217;ve had a few days to test the libraries I cobbled together for using openFrameworks with iPhone and also received positive reports from some folks who tried out the Makefiles I provided to them, so here they are for anyone who&#8217;s willing to try them out. -please make these instructions better if you see fit- <span id="more-593"></span></p>
<p>Update (7.8.2009): Fixed some errant quote mark substitutions in the freetype configure line. Also corrected a tab formatting error in the freeimage makefile.</p>
<p>Ok, here goes. This is going to be a work-in-progress document. Of course, there are no promises with this and your mileage may vary&#8230;but it&#8217;s been working for me. Please report success (and trouble, hopefully with workarounds).</p>
<p>The basic &#8220;tutorial&#8221; I followed is on Memo Akten&#8217;s blog, <a href="http://memo.tv/developing_for_iphone_using_openframeworks_and_ofxiphone" onclick="pageTracker._trackPageview('/outgoing/memo.tv/developing_for_iphone_using_openframeworks_and_ofxiphone?referer=');">memo.tv</a></p>
<p>I&#8217;d highly suggest following Memo&#8217;s tutorial for setting up the development environment. However, there are three libraries that he mentions in his article that need to be built for the iPhone specifically: <a href="http://code.google.com/p/iphone-glu/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/iphone-glu/?referer=');">glu</a>, <a href="http://www.freetype.org/" onclick="pageTracker._trackPageview('/outgoing/www.freetype.org/?referer=');">freetype</a> and <a href="http://freeimage.sourceforge.net/" onclick="pageTracker._trackPageview('/outgoing/freeimage.sourceforge.net/?referer=');">freeimage</a>. Although he mentions that they have been ported to iPhone I wasn&#8217;t able to locate binaries of the libraries, and went through the process of cross-compiling them myself. This post documents what I needed to do to accomplish that.</p>
<p>You&#8217;ll need to download the source for each of the libraries listed above, as well as a svn copy of open frameworks plus the <a href="http://code.google.com/p/ofxiphone/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/ofxiphone/?referer=');">ofxiPhone</a>, <a href="http://code.google.com/p/ofxmsaof/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/ofxmsaof/?referer=');">ofxMultiTouch and ofxAccelerometer</a> addons. I preferred to use <a href="http://github.com/lian/ofx-dev/tree/master" onclick="pageTracker._trackPageview('/outgoing/github.com/lian/ofx-dev/tree/master?referer=');">ofx-dev</a> which bundled this and many more addons. You also need the <a href="http://developer.apple.com/" onclick="pageTracker._trackPageview('/outgoing/developer.apple.com/?referer=');">Apple Developer Tools</a> including Xcode and the iPhone SDK.</p>
<p><strong>GLU for iPhone:</strong><br />
The glu for iphone package builds painlessly. Build twice: once for the iPhone, once for the iPhone Simulator. Make sure to do a &#8220;make clean&#8221; before building the second version. The readme explains the make command. I copied the entire folder to ofx-dev/libs/gluiphone</p>
<p>The other two were more difficult for me. I&#8217;ve never cross-compiled, so perhaps that contributed to the trouble I had.</p>
<p><strong>FreeImage:</strong><br />
Here is the makefile that I came up with, based on the existing files and what I saw in the glu makefile. Copy the makefile listed below as &#8220;Makefile.iphone&#8221; alongside the others in the source directory, then run &#8220;make -f Makefile.iphone&#8221;. This should build both the iPhone and iPhone Simulator libraries into the &#8220;Dist&#8221; folder. Copy both files to ofx-dev/libs/freeimage/lib</p>
<div style="max-width:550px">
<pre class="brush: cpp; wrap-lines: false;">
# Configuration for iPhone OS, making static libs
# this will generate both iPhone (arm) and iPhoneSimulator (i686) libs

include Makefile.srcs

CFLAGS =  -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing
CXXFLAGS =  -g -O2 -Wall -fno-strict-aliasing

GCC_VERSION = 4.0
IPHONEOS_DEPLOYMENT_TARGET = 2.1
MACOSX_DEPLOYMENT_TARGET = 10.5

PLATFORM_SIM = iPhoneSimulator
PLATFORM_PHONE = iPhoneOS

ARCH_SIM = i686
ARCH_PHONE = armv6

PLATFORM_SIM_DEVELOPER_BIN_DIR = /Developer/Platforms/$(PLATFORM_SIM).platform/Developer/usr/bin
PLATFORM_PHONE_DEVELOPER_BIN_DIR = /Developer/Platforms/$(PLATFORM_PHONE).platform/Developer/usr/bin

SDKROOT_SIM = /Developer/Platforms/$(PLATFORM_SIM).platform/Developer/SDKs/$(PLATFORM_SIM)$(IPHONEOS_DEPLOYMENT_TARGET).sdk
SDKROOT_PHONE = /Developer/Platforms/$(PLATFORM_PHONE).platform/Developer/SDKs/$(PLATFORM_PHONE)$(IPHONEOS_DEPLOYMENT_TARGET).sdk

EXTRA_CFLAGS_SIM += -arch $(ARCH_SIM) -pipe -mdynamic-no-pic -fvisibility=hidden $(INCLUDE) -isysroot $(SDKROOT_SIM)
EXTRA_LDFLAGS_SIM += -arch $(ARCH_SIM) -isysroot $(SDKROOT_SIM) -Wl,-dead_strip
EXTRA_CFLAGS_SIM += -D__IPHONE_OS_VERSION_MIN_REQUIRED=20000 -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
EXTRA_LDFLAGS_SIM += -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)

EXTRA_CFLAGS_PHONE += -arch $(ARCH_PHONE) -pipe -mdynamic-no-pic -fvisibility=hidden $(INCLUDE) -isysroot $(SDKROOT_PHONE)
EXTRA_LDFLAGS_PHONE += -arch $(ARCH_PHONE) -isysroot $(SDKROOT_PHONE) -Wl,-dead_strip
EXTRA_CFLAGS_PHONE += -miphoneos-version-min=$(IPHONEOS_DEPLOYMENT_TARGET)
EXTRA_LDFLAGS_PHONE += -miphoneos-version-min=$(IPHONEOS_DEPLOYMENT_TARGET)

AR_SIM = $(PLATFORM_SIM_DEVELOPER_BIN_DIR)/ar
AR_PHONE = $(PLATFORM_PHONE_DEVELOPER_BIN_DIR)/ar

CC_SIM = $(PLATFORM_SIM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION)
CC_PHONE = $(PLATFORM_PHONE_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION)

CFLAGS_SIM = $(CFLAGS) $(EXTRA_CFLAGS_SIM)
LDFLAGS_SIM = $(EXTRA_LDFLAGS_SIM)
CXX_SIM = $(PLATFORM_SIM_DEVELOPER_BIN_DIR)/g++-$(GCC_VERSION)
CXXFLAGS_SIM += $(EXTRA_CFLAGS_SIM) -fvisibility-inlines-hidden
LIBTOOL_SIM = /Developer/Platforms/$(PLATFORM_SIM).platform/Developer/usr/bin/libtool

CFLAGS_PHONE = $(CFLAGS) $(EXTRA_CFLAGS_PHONE)
LDFLAGS_PHONE += $(EXTRA_LDFLAGS_PHONE)
CXX_PHONE = $(PLATFORM_PHONE_DEVELOPER_BIN_DIR)/g++-$(GCC_VERSION)
CXXFLAGS_PHONE += $(EXTRA_CFLAGS_PHONE) -fvisibility-inlines-hidden
LIBTOOL_PHONE = /Developer/Platforms/$(PLATFORM_PHONE).platform/Developer/usr/bin/libtool

TARGET = freeimage
STATICLIB_SIM = lib$(TARGET)-iphonesimulator.a
STATICLIB_PHONE = lib$(TARGET)-iphone.a
HEADER = Source/FreeImage.h

.SUFFIXES: .o-i686 .o-arm
MODULES_ARM = $(SRCS:.c=.o-arm)
MODULES_ARM := $(MODULES_ARM:.cpp=.o-arm)
MODULES_i686 = $(SRCS:.c=.o-i686)
MODULES_i686 := $(MODULES_i686:.cpp=.o-i686)

default: all

all: dist

dist: FreeImage
	cp *.a Dist
	cp Source/FreeImage.h Dist

FreeImage: $(STATICLIB_SIM) $(STATICLIB_PHONE)

$(STATICLIB_SIM): $(MODULES_i686)
	$(LIBTOOL_SIM) -arch_only i686 -o $@ $(MODULES_i686)

.c.o-i686:
	$(CC_SIM) $(CFLAGS_SIM) -c $&lt; -o $@

.cpp.o-i686:
	$(CXX_SIM) $(CXXFLAGS_SIM) -c $&lt; -o $@

$(STATICLIB_PHONE): $(MODULES_ARM)
	$(LIBTOOL_PHONE) -arch_only armv6 -o $@ $(MODULES_ARM)

.c.o-arm:
	$(CC_PHONE) $(CFLAGS_PHONE) -c $&lt; -o $@

.cpp.o-arm:
	$(CXX_PHONE) $(CXXFLAGS_PHONE) -c $&lt; -o $@

clean:
	rm -f core Dist/*.* u2dtmp* $(MODULES_i686) $(MODULES_ARM) $(STATICLIB_SIM) $(STATICLIB_PHONE)
</pre>
</div>
<p><strong>FreeType:</strong><br />
Their makefile situation got me all confused so i just passed command like configure arguments as necessary. This is pretty ugly. -Please make this better someone-</p>
<div style="max-width:550px">
<pre class="brush: cpp; wrap-lines: false;">
#building freetytpe for iphone
# for iPhone
./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 CFLAGS=&quot;-arch armv6 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include/libxml2 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk&quot; CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar LDFLAGS=&quot;-arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -Wl,-dead_strip -miphoneos-version-min=2.0&quot;

# for iPhone simulator
./configure --prefix=/usr/local/iphone --enable-static=yes --enable-shared=no CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 CFLAGS=&quot;-arch i686 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -mmacosx-version-min=10.5  -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/include/ -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk&quot; CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar LDFLAGS=&quot;-arch i686 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk -Wl,-dead_strip -mmacosx-version-min=10.5&quot;
</pre>
</div>
<p>Run one of the configure lines, then make. I got an error about &#8220;asm&#8221; being undefined&#8230;I think it was in include/freetype/config/ftconfig.h. Change &#8220;asm&#8221; to &#8220;__asm__&#8221; (that&#8217;s two underscores for both prefix and suffix). If it works then it drops the lib in a hidden dir: &#8220;./objs/.libs&#8221;.  Copy the static lib out of there and rename it as appropriate.  i&#8217;m using libfreetype-iphone.a and libfreetype-iphonesimulator.a. Run make clean and then run the other configure line and make again. There were some headers missing in from the freetype lib provided with ofx-dev that I noticed in the example ofxiPhone aps&#8230;so I copied the entire freetype folder to ofx-dev/libs/freetype-iphone. I put the libraries into freetype-iphone/lib so i could keep everything straight when setting up xcode.</p>
<p>Ok, I think this gets up to the point where we can set up xcode.</p>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/ofxiphone_xcode.png" rel="lightbox[593]"><img class="alignright size-thumbnail wp-image-602" title="ofxiphone_xcode" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/ofxiphone_xcode-150x150.png" alt="ofxiphone_xcode" width="150" height="150" /></a>Copy one of the ofxiPhone examples to ofx-dev/apps/dev and open it up in xcode. I used the Graphics example. There is some more explanation on Memo&#8217;s site about the project structure, but it was very similar to adding any other addons. However, I put gluiphone, freetype-iphone and freeimage into the libs&gt;core&gt;core libraries package in the xcode project. I&#8217;ve attached a screenshot to illustrate better than i can explain. (ofxVectorMath is there for the specific project i have open, is not required).</p>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/user-search-paths.png" rel="lightbox[593]"><img class="alignleft size-thumbnail wp-image-603" style="margin-right: 2px;" title="user-search-paths" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/user-search-paths-150x150.png" alt="user-search-paths" width="150" height="150" /></a></p>
<p>Go to menu Project&gt;Edit Project Settings&#8230; and switch to the build tab. Set configuration to &#8220;All Configurations&#8221; and add in the library and header search paths as appropriate&#8230;just like setting up addons.</p>
<p>Set the Overview to Simulator &#8211; 2.0 | Debug and try to build. Make sure that all the appropriate libraries have been added to the Target. xcode seems to be able to pick the correct ones for the given architecture.</p>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/library-search-paths.png" rel="lightbox[593]"><img class="size-thumbnail wp-image-601 alignright" title="library-search-paths" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/03/library-search-paths-150x125.png" alt="library-search-paths" width="150" height="125" /></a></p>
<p>I initially got an error about a bad BOOL typedef in FreeImage.h:130 I changed it to typedef int8_t BOOL. In perhaps a separate issue, I don&#8217;t seem to be able to use the &#8220;Boolean&#8221; datatype, but can replace it with &#8220;bool&#8221; instead.</p>
<p>So, that&#8217;s what I did to get my system all set up to use openFrameworks with the iPhone. Feel free to let me know how it works out if you use this for yourself. Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2009/03/25/openframeworks-iphone-libs-593/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iPhone pinwheel: 4in4 day two</title>
		<link>http://robertcarlsen.net/2009/01/13/iphone-pinwheel-4in4-day-two-289</link>
		<comments>http://robertcarlsen.net/2009/01/13/iphone-pinwheel-4in4-day-two-289#comments</comments>
		<pubDate>Wed, 14 Jan 2009 01:14:34 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[4in4]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[itp]]></category>
		<category><![CDATA[obj-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/blog/?p=289</guid>
		<description><![CDATA[the iphone is missing one of my most beloved relics of os x&#8230;the pinwheel, aka beachball of doom/death. i wanted to experiment with using the core graphics framework to draw to the screen and create animation and this was an interesting experience.
the animation is too slow currently&#8230;i feel that i&#8217;m doing things in a really [...]]]></description>
			<content:encoded><![CDATA[<p>the iphone is missing one of my most beloved relics of os x&#8230;the pinwheel, aka beachball of doom/death. i wanted to experiment with using the core graphics framework to draw to the screen and create animation and this was an interesting experience.</p>
<p>the animation is too slow currently&#8230;i feel that i&#8217;m doing things in a really inefficient way at the moment. i had also tried using UIImageViews and animating them, but i couldn&#8217;t figure out a way to get the spinning layer to composite using the overlay blend mode&#8230;which you can easily do with core graphics contexts.</p>
<p>i&#8217;ll try again later, but i really need to get away from the computer and onto my bike to train (which is a matter of about five feet now that it&#8217;s dark and icy out). i&#8217;ll post a video if i can get the animation on the phone  to happen more quickly.</p>
<p><img class="aligncenter size-full wp-image-290" title="pinwheel" src="http://robertcarlsen.net/blog/wp-content/uploads/2009/01/pinwheel.png" alt="pinwheel" width="320" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2009/01/13/iphone-pinwheel-4in4-day-two-289/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>my first iphone app :)</title>
		<link>http://robertcarlsen.net/2009/01/12/my-first-iphone-app-276</link>
		<comments>http://robertcarlsen.net/2009/01/12/my-first-iphone-app-276#comments</comments>
		<pubDate>Mon, 12 Jan 2009 06:51:28 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[cloud reader]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eye]]></category>
		<category><![CDATA[follower]]></category>
		<category><![CDATA[itp]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/blog/?p=276</guid>
		<description><![CDATA[(i was going for a fisher-price approach with the title&#8230;)
regardless, i&#8217;ve finally gotten around to iPhone development. my developer account was approved last week, and apple happily took my $99 in exchange for slightly greater access to their website and a application code signing certificate. in preparation, i&#8217;ve been reading the requisite docs on objective-c, [...]]]></description>
			<content:encoded><![CDATA[<p>(i was going for a fisher-price approach with the title&#8230;)</p>
<p>regardless, i&#8217;ve finally gotten around to iPhone development. my developer account was approved last week, and apple happily took my $99 in exchange for slightly greater access to their website and a application code signing certificate. in preparation, i&#8217;ve been reading the requisite docs on objective-c, cocoa and iphone application programming. also, working on <a href="http://robertcarlsen.net/blog/?p=271">golden cheetah</a> got me comfortable (sort of) coding in xcode. <span id="more-276"></span></p>
<p>i have plans for an extensive port of <a href="http://robertcarlsen.net/cloudreader">cloud reader</a>, but for an initial run here&#8217;s a demo video of the <a href="http://robertcarlsen.net/blog/?p=198">follower app</a> from the ITP haunted house running on iphone. it&#8217;s simply tracking taps and drags now, but i&#8217;d like to use the accelerometer next. check out the video:</p>
<p><img src="http://robertcarlsen.net/blog/wp-content/plugins/flash-video-player/default_video_player.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2009/01/12/my-first-iphone-app-276/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://robertcarlsen.net/blog/wp-content/uploads/2009/01/follower_iphone_demo-h264-300.mov" length="" type="" />
		</item>
	</channel>
</rss>
