Disable PIC on Windows
MODIFY
build.rs
build.rs
@@ -974,6 +974,7 @@ fn build_compiler(opencv: &Library) -> cc::Build {
.flag_if_supported("-wd4190") // has C-linkage specified, but returns UDT 'Result<cv::Rect_<int>>' which is incompatible with C
.flag_if_supported("-EHsc")
.flag_if_supported("-bigobj")
+ .pic(false)
;
} else {
out.flag("-std=c++11")

MODIFY
ci/script.sh
ci/script.sh
@@ -60,10 +60,7 @@ cargo test --release -vv --no-default-features --features "$CARGO_FEATURES"
cargo test --release -vv --no-default-features --features "$CARGO_FEATURES,clang-runtime"
-# on windows clang through `cc` crate fails because of -fPIC flag
-if [[ "$OS_FAMILY" != "windows" ]]; then
export CXX=clang++
touch build.rs
cargo test -vv --no-default-features --features "$CARGO_FEATURES"
cargo test --release -vv --no-default-features --features "$CARGO_FEATURES"
-fi

Disable PIC on Windows