uhmm, pkg-config does not install anything at all !
(you probably need to build opencv libs from src, before you can use them !)
please check, if you can find the opencv libs in /usr/local/lib
incomplete cmdline, leading to linker errors, indeed.
it might be:
note, that this is not supported by default (not recommended !)
it needs a special cmake flag (OPENCV_GENERATE_PKGCONFIG=ON) to generate that info during install
Hallo, Thanks for your reply! But I have just uninstalled everything and try to build it with source code from scratch, with the following cmake command:
And I received the following error during make process:
[ 51%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/vulkan/vk_functions.cpp.o
[ 51%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/vulkan/vk_loader.cpp.o
sure, the error above is like following:
[ 30%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/opengl.cpp.o
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/ocl.cpp:7050:9: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(buf, âconvert_%sâ, typestr);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(msg)))
^
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/ocl.cpp:7053:9: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(buf, "convert%s%s_rte", typestr, (ddepth < CV_32S ? â_satâ : ââ));
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(msg)))
^
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/ocl.cpp:7055:9: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(buf, "convert%s_sat", typestr);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
^
[ 30%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/out.cpp.o
and here as well
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/persistence_yml.cpp.o
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/persistence.cpp:168:5: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(dt, â%d%câ, cn, symbol);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
^
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/rand.cpp.o
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/softfloat.cpp.o
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/split.dispatch.cpp.o
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/persistence_xml.cpp:211:25: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf( data, â#x%02xâ, (uchar)c );
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
^
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/persistence_xml.cpp:312:13: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf( ptr, ââ, comment );
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
^
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/persistence_xml.cpp:347:13: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf( ptr, ââ>â );
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
^
3 warnings generated.
/Users/apple/Desktop/opencv-4.7.0/modules/core/src/persistence_yml.cpp:155:25: warning: âsprintfâ is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf( data, âx%02xâ, c );
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: âsprintfâ has been explicitly marked deprecated here
__deprecated_msg(âThis function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.â)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro â__deprecated_msgâ #define __deprecated_msg(_msg) attribute((deprecated(_msg)))
^
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat.dispatch.cpp.o
this is what I have after make -j1 all
(base) eduroam-141-23-157-226:build apple$ make -j1 all
[ 0%] Built target opencv_dnn_plugins
[ 0%] Built target opencv_highgui_plugins
[ 0%] Built target gen-pkgconfig
[ 0%] Built target jsimd
[ 1%] Built target libopenjp2
[ 4%] Built target carotene_objs
[ 4%] Built target tegra_hal
[ 4%] Built target opencv_videoio_plugins
[ 5%] Built target ittnotify
[ 7%] Built target zlib
[ 13%] Built target opencv_core
[ 17%] Built target opencv_imgproc
[ 21%] Built target libjpeg-turbo
[ 24%] Built target libtiff
[ 31%] Built target libwebp
[ 32%] Built target libpng
make[2]: *** No rule to make target zlib', needed by lib/libopencv_imgcodecs.4.7.0.dylibâ. Stop.
make[1]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make: *** [all] Error 2