Ask Your Question

Revision history [back]

ld: library not found for existing opencv libraries OSX

I try to compile code with opencv 3.3.0 by makefile as below:

LIBS_OPENCV = $(PREFIX)pkg-config --libs opencv

INCLUDE_OPENCV = $(PREFIX)pkg-config --cflags opencv

default:

gcc -std=c99 -O3 -Wall -Werror -pedantic -Wno-unused-function -Wno-unused-parameter -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -c vibe-background-sequential.c

gcc -o main -std=c99 -O3 -Wall -Werror -pedantic your-main-file-sequential.c vibe-background-sequential.o

g++ -o main-opencv -O3 -Wall -Werror -pedantic $(INCLUDE_OPENCV) main-opencv.cpp vibe-background-sequential.o $(LIBS_OPENCV)

However, i get the error: ld: library not found for -llibopencv_stitching.3.3.0.dylib, Inpact, not only libopencv_stitching.3.3.0.dylib, it not found for all libraries of OPENCV while them exist ( as i check in picture below).

image description

image description

I don't know where is prolem? Thanks for any help!