title: file was built for i386 which is not the architecture being linked (x86_64) while compiling OpenCV2.2 for iOS 4.2 on Mac OSX 10.6
body: <p>I have been following the simple guide at <a href="http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2" rel="noreferrer">http://www.atinfinity.info/wiki/index.php?OpenCV/Using%20OpenCV%202.2%20on%20iOS%20SDK%204.2</a> (which uses the older guide I've also read at <a href="http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en" rel="noreferrer">http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en</a>) to get OpenCV2.2 compiled to work on iOS 4.2. Everything went smoothly until I tried to build. When I run the following:</p>
  
  <pre><code>lc:opencv_simulator leonard$ ../opencv_cmake.sh Simulator ../../OpenCV-2.2.0/
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib,
    file was built for i386 which is not the architecture being linked (x86_64)
  </code></pre>
  
  <p>This is using (among other settings, obviously):</p>
  
  <pre><code>-D CMAKE_OSX_ARCHITECTURES="i386"
  </code></pre>
  
  <p>I read that on OSX 10.6 i386 is seen as the default, so it uses the system default (but that is x86_64). I also read I could use:</p>
  
  <pre><code>export CFLAGS=-m32
  export CPPFLAGS=-m32
  </code></pre>
  
  <p>But this doesn't work either.</p>
  
  <p>Any ideas?</p>