Ask Your Question
-1

installing OpenCV on Mac OSX

asked 2013-02-28 05:00:31 -0600

soichi gravatar image

Mac os 10.8.2 opencv latest xcode command line tool latest gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) brew version 0.9.4

I have installed openCV with homebrew, and setup paths for libraries. PKG_CONFIG_PATH=/usr/local/Cellar/opencv/2.4.3/lib/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH DYLD_FALLBACK_LIBRARY_PATH=/usr/local/Cellar/opencv/2.4.3/lib:$DYLD_FALLBACK_LIBRARY_PATH

in .zshrc

But a simple code like

include "highgui.h"

int main(int argc, char** argv) {

IplImage* img = cvLoadImage( argv[1], CV_LOAD_IMAGE_COLOR ); cvNamedWindow("example1", CV_WINDOW_AUTOSIZE); cvShowImage("example2", img); cvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow("example1"); }

fails to build

Could anyone help me install openCV properly?

the error message follows

Using built-in specs. Target: i686-apple-darwin11 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/cc1 -quiet -v -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/ -D__DYNAMIC__ example-2.1.c -fPIC -quiet -dumpbase example-2.1.c -mmacosx-version-min=10.8.2 -m64 -mtune=core2 -auxbase example-2.1 -version -o /var/folders/hk/1clspzcd49d173p3pvpk1f3w0000gn/T//ccSUavgW.s ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include" ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"

include "..." search starts here:

include <...> search starts here:

/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include /usr/local/include /Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) (i686-apple-darwin11) compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00). GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072 Compiler executable checksum: 72ea1d123312df92a792c3841e21247d /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/as -arch x86_64 -force_cpusubtype_ALL -o /var/folders/hk/1clspzcd49d173p3pvpk1f3w0000gn/T//ccZeGswn.o /var/folders/hk/1clspzcd49d173p3pvpk1f3w0000gn/T//ccSUavgW.s /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/collect2 -dynamic -arch x86_64 -macosx_version_min 10.8.2 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/llvm-gcc-4.2/bin/../lib/gcc ... (more)

edit retag flag offensive close merge delete

Comments

Your question is unreadable. Please refactor it using internal tools (e.g. binary for code sample) or I will delete it.

AlexanderShishkov gravatar imageAlexanderShishkov ( 2013-02-28 05:34:52 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-21 20:56:08 -0600

Arpit gravatar image

You can try using this OpenXcodeTemplate

You will have opencv up and running in 2 min

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-28 05:00:31 -0600

Seen: 1,596 times

Last updated: Oct 21 '14