<h1>Xcode project</h1>
<p>First, you must be sure, all libs (OpenCV, Irrlicht) are build for the same architecture (e.g. Intel 64 bit).</p>
<p>Then you could create an XCode project:</p>
<ul>
<li>You must link the Irrlicht static lib (libirrlicht.a).</li>
<li>You must link OpenCV dynamic libs (several of them)</li>
</ul>
<h2 id="LinkingIrrlicht">Linking Irrlicht</h2>
<p>First, it is *not* necessary to create Carbon, Cocoa or other special application. Command line will do.</p>
<p>My *Build Settings* were following:</p>
<ul>
<li>Architectures: 64-bit Intel (just my option, you could use 32-bit, but irrlicht must be also build as 32-bit lib)</li>
<li>Base SDK: 10.7 Lion (again does not matter)</li>
<li>Build Active Architecture only: YES</li>
<li>Compiler: Apple LLVM 3.1 (also GCC 4.2 will do)</li>
<li>C++ standard library: *libstdc++*</li>
<li>GCC_PRECOMPILE_PREFIX_HEADER = YES</li>
<li>GCC_PREFIX_HEADER = (empty)</li>
</ul>
<p>In *Build Phases* just link the binary with following files:</p>
<ul>
<li>Frameworks:
<ul>
<li>IOKit</li>
<li>OpenGL</li>
<li>Carbon</li>
<li>Cocoa</li>
</ul>
</li>
<li>Other files:
<ul>
<li>libirrlicht.a (e.g. in /usr/lib)</li>
</ul>
</li>
</ul>
<p>Now, click in XCode file browser on *libirrlicht.a* and in *Utilities* pane (right side) look in *Identity and Type* section. *File Type* must be *Mach-O object code*.</p>
<h2 id="LinkingOpenCV">Linking OpenCV</h2>
<p>In *Build settings*</p>
<p>Add to the *Header Search Path* path to the OpenCV include files (e.g. /opt/local/include).</p>
<p>In *Build Phases* just link the binary with following files (Other button):</p>
<ul>
<li>/opt/local/lib/libopencv_calib3d.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_contrib.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_core.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_features2d.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_flann.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_gpu.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_highgui.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_imgproc.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_legacy.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_ml.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_objdetect.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_ts.2.3.1.dylib</li>
<li>/opt/local/lib/libopencv_video.2.3.1.dylib</li>
</ul>
<p>Not all libs are necessary. That depends on your application.</p>
<h2 id="Conclusion">Conclusion</h2>
<p>Thats all. Just be carefull on versions of libs (32/64-bit), appropriate settings of the .a lib and compiler settings.</p>