You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# link stdc++ staticexport CXXSTDLIB=static=stdc++
# link opencv module static (static=static=module !important)# because first "static=" is opencv find lib, second "static=" is link to static (has other method ?)export OPENCV_LINK_LIBS=static=static=opencv_world4110,static=static=opencv_img_hash4110,static=static=IlmImf,static=static=ade,static=static=libjpeg-turbo,static=static=libopenjp2,static=static=libpng,static=static=libtiff,static=static=libwebp,static=static=z
# link path (both opencv and stdc++)export OPENCV_LINK_PATHS="/Users/cariers.kim/x86/opencv/lib,/Users/cariers.kim/x86/opencv/lib/opencv4/3rdparty,/opt/homebrew/Cellar/mingw-w64/12.0.0_2/toolchain-x86_64/x86_64-w64-mingw32/lib"# include opencvexport OPENCV_INCLUDE_PATHS="/Users/cariers.kim/x86/opencv/include/opencv4"#build
cargo build --target x86_64-pc-windows-gnu --release -vv
Tks opencv-rs ! great !
The text was updated successfully, but these errors were encountered:
This is a demo for cross compile mac to windows static program
tips: clone gflags, glog, opencv, opencv_contrib open source to disk.
1. build gflags
cmake .. \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_SYSTEM_PROCESSOR=x86_64 \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ -DGFLAGS_NAMESPACE=google \ -DCMAKE_INSTALL_PREFIX=/Users/cariers.kim/x86/gflags make -j$(sysctl -n hw.ncpu) make install
2. build glog
cmake .. \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_SYSTEM_PROCESSOR=x86_64 \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ -Dgflags_DIR=/Users/cariers.kim/x86/gflags/lib/cmake/gflags \ -DCMAKE_INSTALL_PREFIX=/Users/cariers.kim/x86/glog \ -DWITH_UNWIND=none make -j$(sysctl -n hw.ncpu) make install
3. build opencv (I did build some module success )
cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_SYSTEM_PROCESSOR=x86_64 \ -DCMAKE_CXX_FLAGS=-fpermissive \ -DCMAKE_C_COMPILER=/opt/homebrew/bin/x86_64-w64-mingw32-gcc \ -DCMAKE_CXX_COMPILER=/opt/homebrew/bin/x86_64-w64-mingw32-g++ \ -DCMAKE_INSTALL_PREFIX=/Users/cariers.kim/x86/opencv \ -DOPENCV_EXTRA_MODULES_PATH=/Users/cariers.kim/open-source/opencv_contrib-4.10.0/modules \ -DGFLAGS_NAMESPACE=google \ -DGFLAGS_INCLUDE_DIR=/Users/cariers.kim/x86/gflags/include/gflags \ -DGflags_DIR=/Users/cariers.kim/x86/gflags/lib/cmake/gflags \ -Dgflags_DIR=/Users/cariers.kim/x86/gflags/lib/cmake/gflags \ -DGLOG_INCLUDE_DIR=/Users/cariers.kim/x86/glog/include/glog \ -DGlog_DIR=/Users/cariers.kim/x86/glog/lib/cmake/glog \ -DBUILD_SHARED_LIBS=OFF \ -DBUILD_PROTOBUF=OFF \ -DBUILD_opencv_hdf=OFF \ -DBUILD_opencv_world=ON \ -DBUILD_OPENEXR=ON \ -DWITH_PROTOBUF=OFF \ -DWITH_ZLIB_NG=ON make -j$(sysctl -n hw.ncpu) make install
4. build opencv-rs applicaion
Cargo.toml
main.rs
build shell
Tks opencv-rs ! great !
The text was updated successfully, but these errors were encountered: