尝试在MAC OS 10.12.2(Sierra)上安装OpenCV3.1 for Java。遵循此link中的命令。我想安装它,以便我可以使用OpenCV配置Eclipse。
安装时出现一些错误(尝试多次)
尝试1:
brew install opencv3
错误代码段
[55%]建立目标opencv_imgcodecs make:*** [all]错误2
尝试2:
brew install opencv3 --HEAD --with-java
错误代码段
[58%]链接CXX共享库../../lib/libopencv_features2d.dylib cd / tmp / opencv3-20161216-63759-hur0m6 / macbuild / modules / features2d&& /usr/local/Cellar/cmake/3.7.1/bin/cmake -E cmake_link_script CMakeFiles / opencv_features2d.dir / link.txt --verbose = 1 / usr / local / Homebrew / Library / Homebrew / shims / super / clang ++ -I / Library / Java / JavaVirtualMachines / jdk1.8.0_111.jdk / Contents / Home / include -I / Library / Java / JavaVirtualMachines / jdk1.8.0_111 .jdk / Contents / Home / include / darwin -fsigned-char -W -Wall -Werror = return-type -Werror = non-virtual-dtor -Werror = address -Werror = sequence-point -Wformat -Werror = format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template -args -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mavx -fvisibility = hidden -fvisibility-inlines-hidden -mf16c -DNDEBUG -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 3.1.0 -current_version 3.1.0 -o ../../lib/libopencv_features2d.3.1.0.dylib -install_name @rpath /libopencv_features2d.3.1.dylib CMakeFiles / opencv_features 2d.dir / src / agast.cpp.o CMakeFiles / opencv_features2d.dir / src / agast_score.cpp.o CMakeFiles / opencv_features2d.dir / src / akaze.cpp.o CMakeFiles / opencv_features2d.dir / src / bagofwords.cpp.o CMakeFiles / opencv_features2d.dir / src / blobdetector.cpp.o CMakeFiles / opencv_features2d.dir / src / brisk.cpp.o CMakeFiles / opencv_features2d.dir / src / draw.cpp.o CMakeFiles / opencv_features2d.dir / src / dynamic.cpp .o CMakeFiles / opencv_features2d.dir / src / evaluation.cpp.o CMakeFiles / opencv_features2d.dir / src / fast.cpp.o CMakeFiles / opencv_features2d.dir / src / fast_score.cpp.o CMakeFiles / opencv_features2d.dir / src / feature2d .cpp.o CMakeFiles / opencv_features2d.dir / src / gftt.cpp.o CMakeFiles / opencv_features2d.dir / src / kaze.cpp.o CMakeFiles / opencv_features2d.dir / src / kaze / AKAZEFeatures.cpp.o CMakeFiles / opencv_features2d.dir /src/kaze/KAZEFeatures.cpp.o CMakeFiles / opencv_features2d.dir / src / kaze / fed.cpp.o CMakeFiles / opencv_features2d.dir / src / kaze / nldiffusion_functions.cpp.o CMakeFiles / opencv_features2d.dir / src / keypoint。 cpp.o CMakeFiles / op encv_features2d.dir / src / main.cpp.o CMakeFiles / opencv_features2d.dir / src / matchers.cpp.o CMakeFiles / opencv_features2d.dir / src / mser.cpp.o CMakeFiles / opencv_features2d.dir / src / orb.cpp.o CMakeFiles / opencv_features2d.dir / opencl_kernels_features2d.cpp.o -Wl,-rpath,/ tmp / opencv3-20161216-63759-hur0m6 / macbuild / lib ../../lib/libopencv_flann.3.1.0.dylib ../。 ./lib/libopencv_ml.3.1.0.dylib ../../lib/libopencv_highgui.3.1.0.dylib ../../../3rdparty/ippicv/unpack/ippicv_osx/lib/libippicv.a .. /../lib/libopencv_videoio.3.1.0.dylib ../../lib/libopencv_imgcodecs.3.1.0.dylib ../../lib/libopencv_imgproc.3.1.0.dylib ../../lib /libopencv_core.3.1.0.dylib cd / tmp / opencv3-20161216-63759-hur0m6 / macbuild / modules / features2d&& /usr/local/Cellar/cmake/3.7.1/bin/cmake -E cmake_symlink_library ../../lib/libopencv_features2d.3.1.0.dylib ../../lib/libopencv_features2d.3.1.dylib ../ ../lib/libopencv_features2d.dylib [58%]建立目标opencv_features2d make:*** [all]错误2
github上针对这些问题提出的建议似乎无法解决问题。有人可以帮我解决这个问题吗?
我也尝试使用命令brew install opencv
安装openCV 2.4.13,这也导致了同样的错误。
答案 0 :(得分:0)
我终于能够安装它了。问题是Java需要设置ANT。虽然我安装了ANT,但我的ENV中没有正确设置ANT_HOME。一旦我正确设置,我就能解决这个安装问题。