<?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>Paul Solt &#187; Mac OS X</title>
	<atom:link href="http://paulsolt.com/tag/mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulsolt.com</link>
	<description>Putting the Inc back in Solt since 2005.</description>
	<lastBuildDate>Tue, 01 May 2012 15:03:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Creating NSDocument using Folder Bundles and UTI Identifiers</title>
		<link>http://paulsolt.com/2012/02/creating-nsdocument-using-folder-bundles-and-uti-identifiers/</link>
		<comments>http://paulsolt.com/2012/02/creating-nsdocument-using-folder-bundles-and-uti-identifiers/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 05:04:16 +0000</pubDate>
		<dc:creator>Paul Solt</dc:creator>
				<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Mac Developer]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[NSDocument]]></category>

		<guid isPermaLink="false">http://paulsolt.com/?p=1239</guid>
		<description><![CDATA[<p>I&#8217;ve been working on a Lion NSDocument-based application that deals with multiple data files. I decided to work with the NSFileWrapper and treat a folder like a single file. (i.e. Xcode Project Files .xcodeproj) I wanted to get an icon to display for the folder and to have it appear as a  single file on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a Lion NSDocument-based application that deals with multiple data files. I decided to work with the NSFileWrapper and treat a folder like a single file. (i.e. Xcode Project Files .xcodeproj) I wanted to get an icon to display for the folder and to have it appear as a  single file on Finder. In the NSDocument you need to implement the two save/load methods to get started and then you need to edit your Info.plist file.</p>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">- (<span style="color: #703daa;">NSFileWrapper</span> *)fileWrapperOfType:(<span style="color: #703daa;">NSString</span> *)typeName</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">                               error:(NSError *<span style="color: #bb2ca2;">__autoreleasing</span> *)outError {</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">    // Save data here ...</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">}</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"></pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">- (<span style="color: #bb2ca2;">BOOL</span>)readFromFileWrapper:(<span style="color: #703daa;">NSFileWrapper</span> *)fileWrapper</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">                     ofType:(<span style="color: #703daa;">NSString</span> *)typeName</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">                      error:(NSError *<span style="color: #bb2ca2;">__autoreleasing</span> *)outError {</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">    // Load data here ...</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;">}</pre>
<pre style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"></pre>
<h2><strong>Problems</strong></h2>
<p>There&#8217;s a few gotchas with the .plist file. In order to create a NSDocument using Folder Bundles you&#8217;ll need to set the UTI Identifier for the Document  Type and the Exported/Imported UTIs. You&#8217;ll find this setting on the Info page for your Xcode Target.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-1244" style="display: block; margin-left: auto; margin-right: auto;" title="Exported UTIs" src="http://paulsolt.com/wp-content/uploads/2012/02/Exported-UTIs.png" alt="" width="705" height="517" /></p>
<ol>
<li>My App doesn&#8217;t load saved bundles (NSFileWrapper), instead it just looks inside the folder.<img style="display: block; margin-left: auto; margin-right: auto;" title="Can't Load Data.png" src="http://paulsolt.com/wp-content/uploads/2012/02/Cant-Load-Data.png" alt="Can t Load Data" width="600" height="397" border="0" /></li>
<li>I tried to undo the Export UTI by deleting it and remove the Identifier, but that doesn&#8217;t help.</li>
<li>By deleting the Identifier I can&#8217;t load &#8220;New documents&#8221;.</li>
</ol>
<div></div>
<h2><strong>Solutions</strong></h2>
<p>There are two solutions, the second one is more robust, but the first will get you back to when it was working.</p>
<h3>Solution 1: Revert back to Xcode template defaults</h3>
<p><img class="aligncenter size-full wp-image-1242" style="display: block; margin-left: auto; margin-right: auto;" title="App Plist file - LSItemContentTypes" src="http://paulsolt.com/wp-content/uploads/2012/02/Plist.png" alt="" width="527" height="255" /></p>
<ol>
<li>Remove all Exported UTIs</li>
<li>Open your App .plist file and remove the LSItemContentTypes from your App .plist file. You can&#8217;t see it in the Target -&gt; Info page.
<ol>
<li>NOTE: if you don&#8217;t delete an empty LSItemContentTypes array, then you won&#8217;t be able to open New files.</li>
<li>If LSITemContentTypes is defined, it&#8217;ll ignore the &#8220;Bundle&#8221; checkbox (LSTypeIsPackage) See the <a title="LSTypeIsPackage" href="http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html" target="_blank">Apple docs</a>.</li>
</ol>
</li>
<li>Make sure &#8220;Bundle&#8221; is checked on the Document Types on your Target&#8217;s Info page, or (LSTypeIsPackage on .plist file)
<ol>
<li>This option is magic and auto generates a Identifier for you. (check your save file with &#8220;mdls&#8221; on the Terminal)</li>
</ol>
</li>
<li>Don&#8217;t use an Identifier if you check the Bundle option (Document is distributed as a bundle)</li>
<li>Clean the Xcode project</li>
</ol>
<p>&nbsp;</p>
<h3>Solution 2: Use the package UTI</h3>
<p>You&#8217;ll need to add the correct <a href="https://developer.apple.com/library/mac/#documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1">LSItemContentTypes</a> found in Apple&#8217;s documentation. I took a look at the Xcode project file with the Terminal utility &#8220;mdls&#8221; (See sample output below)</p>
<ol>
<li>Set a unique identifier (Reverse DNS name) com.Your_Company_Name.Project_Name
<ol>
<li>It needs to match theDocument Type and Exported UTIs</li>
</ol>
</li>
<li>For a bundle, you&#8217;ll need to set the &#8220;Conforms To&#8221; for the Exported UTIs to &#8220;com.apple.package&#8221;
<ol>
<li>Apple Docs: &#8220;A package (that is, a directory presented to the user as a file)&#8221;</li>
</ol>
</li>
<li>I noticed Xcode project files also include, public.composite-content
<ol>
<li>Apple Docs:  &#8221;Base type for mixed content. For example, a PDF file contains both text and special formatting data&#8221;</li>
</ol>
</li>
<li>NOTE: If you mistype com.apple.package, or leave it out, your file folder will be treated like a public.folder, and you&#8217;ll get folder behavior.</li>
<li>Clean the Xcode project</li>
</ol>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="com.apple.package.png" src="http://paulsolt.com/wp-content/uploads/2012/02/com.apple_.package.png" alt="Com apple package" width="600" height="361" border="0" /></p>
<h2></h2>
<h2>Working Icon and Bundle File</h2>
<p>If all goes well you&#8217;ll now see the Icon (icns) file that you created in the Open dialog and the folder will appear to be a bundle.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="OpenDialogWorks.png" src="http://paulsolt.com/wp-content/uploads/2012/02/OpenDialogWorks1.png" alt="OpenDialogWorks" width="600" height="397" border="0" /></p>
<h2>Using MDLS to inspect your files</h2>
<p>The only way it works as a bundle is if the &#8220;com.apple.package&#8221; ContentType is listed, otherwise something is wrong. Check your save files with the &#8220;mdls&#8221; command.</p>
<pre>mdls MathAndArt.xcodeproj/</pre>
<p><img title="Screen Shot 2012-02-02 at 7.57.23 PM.png" src="http://paulsolt.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-02-at-7.57.23-PM1.png" alt="Screen Shot 2012 02 02 at 7 57 23 PM" width="467" height="450" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://paulsolt.com/2012/02/creating-nsdocument-using-folder-bundles-and-uti-identifiers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GLUT Object Oriented Framework on Github</title>
		<link>http://paulsolt.com/2010/08/glut-object-oriented-framework-on-github/</link>
		<comments>http://paulsolt.com/2010/08/glut-object-oriented-framework-on-github/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 06:30:09 +0000</pubDate>
		<dc:creator>Paul Solt</dc:creator>
				<category><![CDATA[Computer Graphics]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[computer animation]]></category>
		<category><![CDATA[cross platform]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[GLUT]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[object oriented wrapper]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://paulsolt.com/?p=610</guid>
		<description><![CDATA[<p>In 2009 I took a Computer Animation course at @RIT I created an object-oriented C++ wrapper for GLUT. The idea was to create a set of classes that could be reused for each of the separate project submissions. The main class wraps around the GLUT C-style functions and provides a class that can be inherited [...]]]></description>
			<content:encoded><![CDATA[<p>In 2009 I took a Computer Animation course at @RIT I created an object-oriented C++ wrapper for GLUT. The idea was to create a set of classes that could be reused for each of the separate project submissions. The main class wraps around the GLUT C-style functions and provides a class that can be inherited from, to provide application specific functionality.</p>
<p>The idea was to make the boiler plate code disappear and make it easier for novice programmers to get an animated graphics window in as few lines as possible. Only four lines of code are needed to get the window running at 60 frames per second. You can subclass the framework and implement your own OpenGL animation or game project.</p>
<p><strong>Edit (8/22/10)</strong>: You don&#8217;t need to use pointers, I&#8217;ve updated the code example with working code.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// main.cpp</span>
<span style="color: #339900;">#include &quot;GlutFramework.h&quot;</span>
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> glutFramework<span style="color: #008080;">;</span>
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> argc, <span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span>argv<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
	GlutFramework framework<span style="color: #008080;">;</span>
	framework.<span style="color: #007788;">startFramework</span><span style="color: #008000;">&#40;</span>argc, argv<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
        <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-2182421302031373";
/* Large Post Ad */
google_ad_slot = "4358587115";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>The code uses a cross-platform (Windows/Mac tested) timer to create a constant frame-rate, which is necessary for animation projects. It&#8217;s under the MIT License, so feel free to use it as you see fit.<br />
<a href=" http://github.com/PaulSolt/GLUT-Object-Oriented-Framework"></p>
<p>http://github.com/PaulSolt/GLUT-Object-Oriented-Framework</a></p>
<p>An Xcode 3.1 and Visual Studio 2010 project is hosted on github to support Mac and Windows. There is no setup on the Mac, but Windows users will need to configure GLUT. I plan on posted tutorials on how to get setup on both platforms. For now, look at the resources section below.</p>
<div id="attachment_617" class="wp-caption aligncenter" style="width: 514px"><a href="http://paulsolt.com/wp-content/uploads/2010/08/teapot.png"><img class="size-full wp-image-617 " title="teapot" src="http://paulsolt.com/wp-content/uploads/2010/08/teapot.png" alt="" width="504" height="407" /></a><p class="wp-caption-text">Animated teapot</p></div>
<p>Resources:</p>
<ul>
<li>Previous Post: <a href="http://paulsolt.com/2009/07/openglglut-classes-oop-and-problems/">http://paulsolt.com/2009/07/openglglut-classes-oop-and-problems/</a></li>
<li>GLUT for Windows: <a href="http://www.xmission.com/~nate/glut.html ">http://www.xmission.com/~nate/glut.html </a></li>
<li>Visual Studio and GLUT setup: <a href="http://www.cs.uiowa.edu/~cwyman/classes/common/howto/winGLUT.html">http://www.cs.uiowa.edu/~cwyman/classes/common/howto/winGLUT.html</a></li>
<li>Old Post on GLUT in Eclipse: <a href="http://www.paulsolt.com/GLUT/">http://www.paulsolt.com/GLUT/</a></li>
</ul>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-2182421302031373";
/* Large Post Ad */
google_ad_slot = "4358587115";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://paulsolt.com/2010/08/glut-object-oriented-framework-on-github/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Player/Stage, MacPorts, and iPhone</title>
		<link>http://paulsolt.com/2009/04/playerstage-macports-and-iphone/</link>
		<comments>http://paulsolt.com/2009/04/playerstage-macports-and-iphone/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 22:43:40 +0000</pubDate>
		<dc:creator>Paul Solt</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Macbook Pro]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[player/stage]]></category>

		<guid isPermaLink="false">http://paulsolt.com/?p=193</guid>
		<description><![CDATA[<p>Today I worked on setting up Player/Stage on my Macbook Pro with Leopard 10.5.6 and I ran into a few issues.</p> <p>I was using Macports 1.710 and I was attempting to install player-stage-player (2.03 2.1.2) and player-stage-stage (2.03 2.1.1) following a short guide at <a href="http://bentham.k2.t.u-tokyo.ac.jp/notebook/?p=247">http://bentham.k2.t.u-tokyo.ac.jp/notebook/?p=247</a></p> <p>If it&#8217;s your first time using macports it can [...]]]></description>
			<content:encoded><![CDATA[<p>Today I worked on setting up Player/Stage on my Macbook Pro with Leopard 10.5.6 and I ran into a few issues.</p>
<p>I was using Macports 1.710 and I was attempting to install player-stage-player (2.03 <span style="text-decoration: line-through;">2.1.2</span>) and player-stage-stage (2.03 <span style="text-decoration: line-through;">2.1.1</span>) following a short guide at <a href="http://bentham.k2.t.u-tokyo.ac.jp/notebook/?p=247">http://bentham.k2.t.u-tokyo.ac.jp/notebook/?p=247</a></p>
<p>If it&#8217;s your first time using macports it can take a long time. I waited 2+ hours to download/build/install dependencies</p>
<p>I used the command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> playerstage-player playerstage-stage</pre></div></div>

<p>However it errored out at the end with the message:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> playerstage-player playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Building playerstage-player
Error: Target org.macports.build returned: shell <span style="color: #7a0874; font-weight: bold;">command</span> <span style="color: #ff0000;">&quot; cd &quot;</span><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>macports<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-player<span style="color: #000000; font-weight: bold;">/</span>work<span style="color: #000000; font-weight: bold;">/</span>player-2.0.4<span style="color: #ff0000;">&quot; &amp;&amp; make all &quot;</span> returned error <span style="color: #000000;">2</span>
Command output: building <span style="color: #ff0000;">'_playerc'</span> extension
swigging playerc.i to playerc_wrap.c
swig <span style="color: #660033;">-python</span> <span style="color: #660033;">-o</span> playerc_wrap.c playerc.i
playerc.i:<span style="color: #000000;">44</span>: Warning<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">124</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Specifying the language name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">%</span>typemap is deprecated - use <span style="color: #666666; font-style: italic;">#ifdef SWIG instead.</span>
playerc.i:<span style="color: #000000;">82</span>: Warning<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">124</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Specifying the language name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">%</span>typemap is deprecated - use <span style="color: #666666; font-style: italic;">#ifdef SWIG instead.</span>
playerc.i:<span style="color: #000000;">121</span>: Warning<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">124</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Specifying the language name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">%</span>typemap is deprecated - use <span style="color: #666666; font-style: italic;">#ifdef SWIG instead.</span>
playerc.i:<span style="color: #000000;">127</span>: Warning<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">124</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Specifying the language name <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">%</span>typemap is deprecated - use <span style="color: #666666; font-style: italic;">#ifdef SWIG instead.</span>
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-fno-strict-aliasing</span> <span style="color: #660033;">-Wno-long-double</span> <span style="color: #660033;">-no-cpp-precomp</span> <span style="color: #660033;">-mno-fused-madd</span> <span style="color: #660033;">-fno-common</span> <span style="color: #660033;">-dynamic</span> <span style="color: #660033;">-DNDEBUG</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-Os</span> <span style="color: #660033;">-Wall</span> <span style="color: #660033;">-Wstrict-prototypes</span> <span style="color: #660033;">-DMACOSX</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>ffi -DENABLE_DTRACE <span style="color: #660033;">-arch</span> i386 <span style="color: #660033;">-arch</span> ppc <span style="color: #660033;">-pipe</span> -I.<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>.. -I..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>.. -I<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>Python.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.5</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>python2.5 <span style="color: #660033;">-c</span> playerc_wrap.c <span style="color: #660033;">-o</span> build<span style="color: #000000; font-weight: bold;">/</span>temp.macosx-<span style="color: #000000;">10.5</span>-i386-<span style="color: #000000;">2.5</span><span style="color: #000000; font-weight: bold;">/</span>playerc_wrap.o
playerc_wrap.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'_wrap_playerc_mclient_client_set'</span>:
playerc_wrap.c:<span style="color: #000000;">40301</span>: warning: assignment from incompatible pointer <span style="color: #7a0874; font-weight: bold;">type</span>
playerc_wrap.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'_wrap_playerc_mclient_addclient'</span>:
playerc_wrap.c:<span style="color: #000000;">40504</span>: warning: passing argument <span style="color: #000000;">2</span> of <span style="color: #ff0000;">'playerc_mclient_addclient'</span> from incompatible pointer <span style="color: #7a0874; font-weight: bold;">type</span>
playerc_wrap.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'_wrap_playerc_mclient_client_set'</span>:
playerc_wrap.c:<span style="color: #000000;">40301</span>: warning: assignment from incompatible pointer <span style="color: #7a0874; font-weight: bold;">type</span>
playerc_wrap.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'_wrap_playerc_mclient_addclient'</span>:
playerc_wrap.c:<span style="color: #000000;">40504</span>: warning: passing argument <span style="color: #000000;">2</span> of <span style="color: #ff0000;">'playerc_mclient_addclient'</span> from incompatible pointer <span style="color: #7a0874; font-weight: bold;">type</span>
<span style="color: #c20cb9; font-weight: bold;">gcc</span> -Wl,-F. <span style="color: #660033;">-bundle</span> <span style="color: #660033;">-undefined</span> dynamic_lookup <span style="color: #660033;">-arch</span> i386 <span style="color: #660033;">-arch</span> ppc build<span style="color: #000000; font-weight: bold;">/</span>temp.macosx-<span style="color: #000000;">10.5</span>-i386-<span style="color: #000000;">2.5</span><span style="color: #000000; font-weight: bold;">/</span>playerc_wrap.o -L.<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>.libs -L..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>libplayerxdr<span style="color: #000000; font-weight: bold;">/</span>.libs -L..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>libplayercore<span style="color: #000000; font-weight: bold;">/</span>.libs -L..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>libplayerjpeg<span style="color: #000000; font-weight: bold;">/</span>.libs <span style="color: #660033;">-lplayerxdr</span> <span style="color: #660033;">-lplayerc</span> <span style="color: #660033;">-lplayerjpeg</span> <span style="color: #660033;">-ljpeg</span> <span style="color: #660033;">-lplayererror</span> <span style="color: #660033;">-o</span> build<span style="color: #000000; font-weight: bold;">/</span>lib.macosx-<span style="color: #000000;">10.5</span>-i386-<span style="color: #000000;">2.5</span><span style="color: #000000; font-weight: bold;">/</span>_playerc.so
<span style="color: #c20cb9; font-weight: bold;">ld</span>: library not found <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #660033;">-ljpeg</span>
collect2: <span style="color: #c20cb9; font-weight: bold;">ld</span> returned <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">exit</span> status
<span style="color: #c20cb9; font-weight: bold;">ld</span>: library not found <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #660033;">-ljpeg</span>
collect2: <span style="color: #c20cb9; font-weight: bold;">ld</span> returned <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">exit</span> status
lipo: can<span style="color: #ff0000;">'t open input file: /var/tmp//ccI9TvVp.out
(No such file or directory)
error: command '</span><span style="color: #c20cb9; font-weight: bold;">gcc</span><span style="color: #ff0000;">' failed with exit status 1
make[6]: *** [pythonbuild] Error 1
make[5]: *** [all] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
&nbsp;
Error: Status 1 encountered during processing.</span></pre></div></div>

<p style="text-align: center;"></p>
<p>So I searched around the MacPorts website and I came across the ticket <a title="Bug Ticket" href="http://trac.macports.org/ticket/18891#comment:3">#18891</a>, which basically said to run the following command to change the version of <strong>python</strong> being used from 3.0 to 2.5.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> python_select <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> python_select python25
Skipping org.macports.activate <span style="color: #7a0874; font-weight: bold;">&#40;</span>python_select +darwin_9<span style="color: #7a0874; font-weight: bold;">&#41;</span> since this
port is already active
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Cleaning python_select
Selecting version <span style="color: #ff0000;">&quot;python25&quot;</span> <span style="color: #000000; font-weight: bold;">for</span> python</pre></div></div>

<p>Following that command I was able to finish installing Player/Stage via MacPorts by using the orginal port command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> playerstage-player playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Building playerstage-player
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Staging playerstage-player into destroot
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Installing playerstage-player <span style="color: #000000; font-weight: bold;">@</span>2.0.4_2
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Activating playerstage-player <span style="color: #000000; font-weight: bold;">@</span>2.0.4_2
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Cleaning playerstage-player
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Fetching playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Attempting to fetch stage-2.0.3.tar.bz2 from
http:<span style="color: #000000; font-weight: bold;">//</span>voxel.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>playerstage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Verifying checksum<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">for</span> playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Extracting playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Configuring playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Building playerstage-stage
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Staging playerstage-stage into destroot
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Installing playerstage-stage <span style="color: #000000; font-weight: bold;">@</span>2.0.3_0
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Activating playerstage-stage <span style="color: #000000; font-weight: bold;">@</span>2.0.3_0
---<span style="color: #000000; font-weight: bold;">&gt;</span>  Cleaning playerstage-stage</pre></div></div>

<p>I tried to use player stage from MacPorts.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ player <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>macports<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>playerstage-stage\
<span style="color: #000000; font-weight: bold;">/*/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>stage<span style="color: #000000; font-weight: bold;">/</span>worlds<span style="color: #000000; font-weight: bold;">/</span>simple.cfg</pre></div></div>

<p>And I received the error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rr: unable to open color database <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11R6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>rgb.txt
 : No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory <span style="color: #7a0874; font-weight: bold;">&#40;</span>stage.c stg_lookup_color<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Following the advice from <a title="PlayerStage setup" href="http://bentham.k2.t.u-tokyo.ac.jp/notebook/?cat=5" target="_blank">http://bentham.k2.t.u-tokyo.ac.jp/notebook/?cat=5</a> I added the following link.</p>
<div id="codebox">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>rgb.txt <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11R6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>rgb.txt</pre></div></div>

<p>Now I am able to create a player server and connect with a client with the commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ player <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>macports<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>playerstage-stage\
<span style="color: #000000; font-weight: bold;">/*/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>stage<span style="color: #000000; font-weight: bold;">/</span>worlds<span style="color: #000000; font-weight: bold;">/</span>simple.cfg
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>macports<span style="color: #000000; font-weight: bold;">/</span>software<span style="color: #000000; font-weight: bold;">/</span>playerstage-player\
<span style="color: #000000; font-weight: bold;">/*/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>player<span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>libplayerc++<span style="color: #000000; font-weight: bold;">/</span>laserobstacleavoid</pre></div></div>

<p>With the ability to run player/stage I will post again on my progress as I use an iPhone to run the Player client, rather than my Macbook Pro.</p>
<div id="attachment_209" class="wp-caption alignleft" style="width: 453px"><a rel="attachment wp-att-209" href="http://paulsolt.com/2009/04/playerstage-macports-and-iphone/robotiphone/"><img class="size-full wp-image-209" title="robotiphone" src="http://paulsolt.com/wp-content/uploads/2009/04/robotiphone.png" alt="Player client running on iPhone with Player/Stage." width="443" height="412" /></a><p class="wp-caption-text">Player client running on iPhone with Player/Stage.</p></div>
</div>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-2182421302031373";
/* Large Post Ad */
google_ad_slot = "4358587115";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://paulsolt.com/2009/04/playerstage-macports-and-iphone/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

