Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows上编译报错,是不是脚本哪里有问题?或者是我的目录有问题? #14

Open
qiaonanxiansheng opened this issue Mar 15, 2024 · 8 comments

Comments

@qiaonanxiansheng
Copy link

image

@qiaonanxiansheng
Copy link
Author

static下面的目录结构如下
image

@qiaonanxiansheng
Copy link
Author

帮帮忙看看,我是按照编译文档一步一步来的。

@benjaminwan
Copy link
Member

看windows-x64或windows-x86里面的include目录结构,如果没有子目录,那么
需要把项目里的所有源代码
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
改成
#include <onnxruntime_cxx_api.h>

@qiaonanxiansheng
Copy link
Author

感谢,我改了之后,编译又报以下错误,麻烦您再指点一下,谢谢。
image

@benjaminwan
Copy link
Member

__std_是标准库,错误信息应该是没有正确链接C标准库(CRT)。

相关的选项:引用库类型: 1)静态CRT(mt), 2)动态CRT(md)

onnxruntime官方仓库和opencv官方仓库提供的全都是md的,或者全网其它任何可以下载到的库,默认都是md的。

如果是选mt,则onnxruntime和opencv都必须同时使用mt的,如果不一致会出错。

只能到这里下载mt版
https://github.com/RapidAI/OnnxruntimeBuilder/releases
https://github.com/RapidAI/OpenCVBuilder/releases

@qiaonanxiansheng
Copy link
Author

我就是下载的静态链接库,因为文档上推荐的就是,我一步一步按照文档来的,最后报的那个错。并且尝试了两遍,还是一样。

@benjaminwan
Copy link
Member

benjaminwan commented Apr 26, 2024

https://github.com/RapidAI/RapidOcrOnnx/releases/download/1.2.2/Project_RapidOcrOnnx-1.2.2.7z

直接用Release里的完整项目,如果还不行,那就是编译环境的问题了。

@pcycccccc
Copy link

@qiaonanxiansheng 我遇到了和你一样的问题,主要原因应该是你下载的Windows-onnxruntime的问题,我按照 @benjaminwan提供的文件,替换了一样文件目录下的onnxruntime-static/windows-x64,编译正常了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants