打开命令行终端,执行以下命令克隆官方仓库并初始化子模块(--recursive 参数非常重要,否则会因为缺少依赖导致编译失败):
git clone --recursive https://github.com/microsoft/onnxruntime.git进入目录:
cd onnxruntime执行:
.\build.bat --config Release --build_shared_lib --cmake_generator "Visual Studio 18 2026" --x86 --compile_no_warning_as_error