nebgnahz / cv-rs

Rust wrapper for OpenCV (manual at this point)
https://nebgnahz.github.io/cv-rs/cv/
MIT License
204 stars 41 forks source link

compile fail on mac #89

Closed foxzool closed 6 years ago

foxzool commented 6 years ago

I have opencv3 installed on mac though brew install opencv, but when i add dependencies to my rust project, cargo build failed

what can i do ?

cargo build 20:14:47 Compiling cv v0.2.2 (https://github.com/nebgnahz/cv-rs.git#ae00da4f) error: failed to run custom build command forcv v0.2.2 (https://github.com/nebgnahz/cv-rs.git#ae00da4f) process didn't exit successfully:/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-1fa3290d39e5c646/build-script-build` (exit code: 101) --- stdout TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") OPT_LEVEL = Some("0") TARGET = Some("x86_64-apple-darwin") OPT_LEVEL = Some("0") OPT_LEVEL = Some("0") OPT_LEVEL = Some("0") OPT_LEVEL = Some("0") OPT_LEVEL = Some("0") OPT_LEVEL = Some("0") TARGET = Some("x86_64-apple-darwin") OPT_LEVEL = Some("0") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") CXX_x86_64-apple-darwin = None CXX_x86_64-apple-darwin = None HOST = Some("x86_64-apple-darwin") CXX_x86_64-apple-darwin = None CXX_x86_64-apple-darwin = None CXX_x86_64-apple-darwin = None CXX_x86_64-apple-darwin = None CXX_x86_64-apple-darwin = None CXX_x86_64_apple_darwin = None CXX_x86_64_apple_darwin = None CXX_x86_64-apple-darwin = None CXX_x86_64_apple_darwin = None CXX_x86_64_apple_darwin = None CXX_x86_64_apple_darwin = None CXX_x86_64_apple_darwin = None CXX_x86_64_apple_darwin = None HOST_CXX = None HOST_CXX = None CXX_x86_64_apple_darwin = None HOST_CXX = None HOST_CXX = None HOST_CXX = None HOST_CXX = None HOST_CXX = None CXX = None CXX = None HOST_CXX = None CXX = None CXX = None CXX = None CXX = None CXX = None HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") CXX = None HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") TARGET = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") HOST = Some("x86_64-apple-darwin") CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64-apple-darwin = None HOST = Some("x86_64-apple-darwin") CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64_apple_darwin = None CXXFLAGS_x86_64_apple_darwin = None CXXFLAGS_x86_64-apple-darwin = None CXXFLAGS_x86_64_apple_darwin = None CXXFLAGS_x86_64_apple_darwin = None CXXFLAGS_x86_64_apple_darwin = None CXXFLAGS_x86_64_apple_darwin = None CXXFLAGS_x86_64_apple_darwin = None HOST_CXXFLAGS = None HOST_CXXFLAGS = None CXXFLAGS_x86_64_apple_darwin = None HOST_CXXFLAGS = None HOST_CXXFLAGS = None HOST_CXXFLAGS = None HOST_CXXFLAGS = None HOST_CXXFLAGS = None CXXFLAGS = None CXXFLAGS = None HOST_CXXFLAGS = None CXXFLAGS = None CXXFLAGS = None CXXFLAGS = None CXXFLAGS = None CXXFLAGS = None DEBUG = Some("true") DEBUG = Some("true") CXXFLAGS = None DEBUG = Some("true") DEBUG = Some("true") DEBUG = Some("true") DEBUG = Some("true") DEBUG = Some("true") DEBUG = Some("true") running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/objdetect.o" "-c" "native/objdetect.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/video.o" "-c" "native/video.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/utils.o" "-c" "native/utils.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/highgui.o" "-c" "native/highgui.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/text.o" "-c" "native/text.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/videoio.o" "-c" "native/videoio.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/hash.o" "-c" "native/hash.cc" running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/features2d.o" "-c" "native/features2d.cc" cargo:warning=In file included from native/text.cc:1: cargo:warning=native/text.h:6:10: fatal error: 'opencv2/text/ocr.hpp' file not found cargo:warning=#include <opencv2/text/ocr.hpp> cargo:warning= ^~~~~~ cargo:warning=1 error generated. exit code: 1 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0 exit code: 0

--- stderr thread 'main' panicked at '

Internal error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "native" "-I" "/usr/local/include" "-Wall" "-Wextra" "--std=c++11" "-o" "/Users/ZoOL/workspace/RustProjects/video_capture/target/debug/build/cv-f926acd0be8e28e6/out/native/text.o" "-c" "native/text.cc" with args "c++" did not execute successfully (status code exit code: 1).

', /Users/ZoOL/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cc-1.0.18/src/lib.rs:2181:5 note: Run with RUST_BACKTRACE=1 for a backtrace. `

Pzixel commented 6 years ago

Dupe of #76

foxzool commented 6 years ago

yes, #76 is work, Please add solutaion to readme