Building OpenCV 2.0 on Mac OS X 10.6

I first tried it this way:


$ cd OpenCV-2.0.0
$ mkdir build
$ cd build
$ cmake ..
$ make

But it failed. I got lots of errors when trying to link highgui to the Carbon libraries. The problem is that Carbon is 32-bit only, and by default OpenCV was being built for 64-bit.

Here the (very simple) solution to that:


$ CFLAGS="-arch i386" CXXFLAGS="-arch i386" cmake ..
$ make

One Comment

  1. Também tive que usar o arch=386 para tentar compilar um programa com a SDL (no fim tive que usar um template para o xCode porque tinha um erro no linker que não consegui resolver por causa da lerdeza da vm de mac, mas eu aposto que esse template já tem o arch nele).
    Pelov isto a maioria dos programas não tá nem aí pra compilar em PPC.

Leave a Reply