mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
555f0901a3
Fix ONNXRuntime dll path mismatch #29309 **1. C2664 build error in `net_impl_backend.cpp`** `EnableProfiling()` expects `const wchar_t*` on Windows (`ORTCHAR_T`), but was passed `const char*`. Fixed by converting to `std::wstring`, as suggested in #29278 --- **2. Wrong ORT DLL loaded at runtime (`modules/dnn/CMakeLists.txt`)** With `DOWNLOAD_ONNXRUNTIME=ON`, the DLL glob only searched `bin/` but the downloaded package places DLLs in `lib/`. This left the build tree with no ORT DLL, causing Windows to fall back to the stale `System32\onnxruntime.dll` (1.17.1), crashing against the ORT 1.25.1 API. Fixed by adding `lib/` as fallback and staging DLLs into the build bin directory at configure time. Closes : #29278 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake