The given version [16] is not supported, only version 1 to 10 is supported in this build.问题以及解决方案
发布时间
阅读量:
阅读量
问题背景
- 编程语言为C++
- 所使用的开发环境基于Windows 11系统
- 所使用的编译器为Visual Studio Community 2022 Release版本
- 采用CMake作为编译工具
- 当程序在运行过程中出现异常时
- 涉及出现问题的库名为onnxruntime-win-x64-gpu-1.16.0
- 报错信息表明指定版本[16]不被支持;仅在构建过程中支持版本范围从1至10
问题时现场
对于onnxruntime库来说,在指定其所在的库路径后链接名为onnxruntime的动态链接库

程序运行状态如下

问题定位
此错误提示因版本16无法显示而被检测出来,并直接将故障定位至onnxruntime库中出现的问题。通过进一步排查和分析后发现原因在于动态链接库onnxruntime.dll存在问题。
无法使用任何OnnxRuntime版本>1.7与CMake协同工作 · Issue #11230 · microsoft.onnxruntime (github.com)
此为GitHub上作者对该问题的解析。此言亦为此处开发者们所指。该问题见于Windows 11系统中,在Windows Systems 32文件夹内位于onnxruntime.dll文件会被程序优先调用,并因该DLL版本较旧而引发上述错误信息。
DLL链接搜索顺序
The dynamic link repository sequence for Windows 32-bit applications is accessible via the Microsoft Learn platform's dedicated interface.
解决方案
当前采取的方案包括,在可执行文件main.exe所在的文件夹内备份一份最新的onnxruntime.dll文件,并且当进行链接搜索操作时能够获得较高的优先级。
全部评论 (0)
还没有任何评论哟~
