Skip to content

Commit 34c9451

Browse files
committed
Cleanup
1 parent ea11564 commit 34c9451

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ the issue you're encountering is not solved thereby please state the following i
1313
1. Operating system
1414
2. The way you installed OpenCV: package, official binary distribution, manual compilation, etc.
1515
3. OpenCV version
16-
4. Attach the full output of the following command from your project directory:
16+
4. rustc version (`rustc --version`)
17+
5. Attach the full output of the following command from your project directory:
1718
```shell script
1819
RUST_BACKTRACE=full cargo build -vv
1920
```

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Installing OpenCV is easy through the following sources:
6565
```shell script
6666
vcpkg install llvm opencv4[contrib,nonfree]
6767
```
68+
You most probably want to set environment variable `VCPKGRS_DYNAMIC` to "1" unless you're specifically
69+
targeting a static build.
6870

6971
### macOS package
7072

@@ -75,7 +77,7 @@ Get OpenCV from homebrew:
7577
brew install pkg-config opencv
7678
```
7779
You will also need a working C++ compiler and libclang, you can use the ones from XCode or install `llvm`
78-
from brew. You most probably need to also check the item 5 of the troubleshooting below.
80+
from brew. You most probably need to also check the item 6 of the troubleshooting below.
7981

8082
### Manual build
8183

@@ -120,7 +122,13 @@ You need to set up the following environment variables to point to the installed
120122
variable correctly or copy the dll next to the binary you're trying to run. Check
121123
[that](https://github.com/twistedfall/opencv-rust/issues/118#issuecomment-619608278) guide too.
122124

123-
5. On macOS you're getting the `dyld: Library not loaded: @rpath/libclang.dylib` error during the build process.
125+
5. On Windows with VCPKG you're getting a lot of linking errors in multiple files like in
126+
[this issue](https://github.com/twistedfall/opencv-rust/issues/161).
127+
128+
Unless you're doing a very specific build, you want to have environment variable `VCPKGRS_DYNAMIC` set to
129+
"1".
130+
131+
6. On macOS you're getting the `dyld: Library not loaded: @rpath/libclang.dylib` error during the build process.
124132

125133
OS can't find `libclang.dylib` dynamic library because it resides in a non-standard path, set up
126134
the `DYLD_FALLBACK_LIBRARY_PATH` environment variable to point to the path where libclang.dylib can be

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ impl Library {
745745
let explicit_pkg_config = env::var_os("PKG_CONFIG_PATH").is_some() || env::var_os("OPENCV_PKGCONFIG_NAME").is_some();
746746
let explicit_cmake = env::var_os("OpenCV_DIR").is_some()
747747
|| env::var_os("OPENCV_CMAKE_NAME").is_some()
748-
|| env::var_os("CMAKE_PREFIX_PATH").is_some();
748+
|| env::var_os("CMAKE_PREFIX_PATH").is_some()
749749
|| env::var_os("OPENCV_CMAKE_BIN").is_some();
750750
let explicit_vcpkg = env::var_os("VCPKG_ROOT").is_some() || cfg!(target_os = "windows");
751751

src/manual/core/vector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<'a, T: VectorElement> Extend<<T as OpenCVType<'a>>::Arg> for Vector<T> wher
216216
let s = s.into_iter();
217217
let (lo, hi) = s.size_hint();
218218
self.reserve(hi.unwrap_or(lo));
219-
s.into_iter().for_each(|elem| {
219+
s.for_each(|elem| {
220220
self.push(elem);
221221
});
222222
}
@@ -300,7 +300,7 @@ impl<T: VectorElement> OpenCVTypeExternContainer for Vector<T> where Self: Vecto
300300
}
301301

302302
#[inline(always)]
303-
pub(crate) fn vector_index_check(index: size_t, len: size_t) -> crate::Result<()> {
303+
fn vector_index_check(index: size_t, len: size_t) -> crate::Result<()> {
304304
if index >= len {
305305
Err(crate::Error::new(crate::core::StsOutOfRange, format!("Index: {} out of bounds: 0..{}", index, len)))
306306
} else {

0 commit comments

Comments
 (0)