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

编译错误: error adding symbols: DSO missing from command line #1

Open
mrbulb opened this issue Oct 19, 2022 · 3 comments
Open

Comments

@mrbulb
Copy link

mrbulb commented Oct 19, 2022

您好,我按照编译说明 对代码进行编译,但出现以下报错,想咨询一下是什么问题?

========请先参考README.md准备好编译环境========

========编译选项========
请输入编译选项并回车: 1)Release, 2)Debug
1
请选择编译输出类型并回车: 1)BIN可执行文件,2)JNI动态库,3)C动态库
请注意:如果选择2)JNI动态库时,必须安装配置Oracle JDK
1
onnxruntime: 1)CPU(默认), 2)GPU(cuda)
注意:范例工程默认集成CPU版,CUDA版仅支持Linux64且需下载
1
~/ocr/RapidOcrOnnx/Linux-CPU-BIN ~/ocr/RapidOcrOnnx
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT=BIN -DOCR_ONNX=CPU ..
配置Linux OnnxRuntime 路径: /home/admin/ocr/RapidOcrOnnx/onnxruntime-static/linux
-- OnnxRuntime_LIBS: onnxruntime_session;onnxruntime_optimizer;onnxruntime_providers;onnxruntime_util;onnxruntime_framework;onnxruntime_graph;onnxruntime_common;onnxruntime_mlas;onnxruntime_flatbuffers;onnx;onnx_proto;protobuf-lite;re2;flatbuffers;nsync_cpp
-- OnnxRuntime_INCLUDE_DIRS: /home/admin/ocr/RapidOcrOnnx/onnxruntime-static/linux/include
配置Linux OpenCV 路径: /home/admin/ocr/RapidOcrOnnx/opencv-static/linux/lib/cmake/opencv4
-- OpenCV_LIBS: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab
-- OpenCV_INCLUDE_DIRS: /usr/local/include;/usr/local/include/opencv
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/ocr/RapidOcrOnnx/Linux-CPU-BIN
Consolidate compiler generated dependencies of target benchmark
Consolidate compiler generated dependencies of target RapidOcrOnnx
[  4%] Linking CXX executable RapidOcrOnnx
[  9%] Linking CXX executable benchmark
/usr/bin/ld: /home/admin/ocr/RapidOcrOnnx/onnxruntime-static/linux/lib/libonnxruntime_common.a(env.cc.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [RapidOcrOnnx] Error 1
gmake[1]: *** [CMakeFiles/RapidOcrOnnx.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: /home/admin/ocr/RapidOcrOnnx/onnxruntime-static/linux/lib/libonnxruntime_common.a(env.cc.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [benchmark] Error 1
gmake[1]: *** [CMakeFiles/benchmark.dir/all] Error 2
gmake: *** [all] Error 2
[  4%] Linking CXX executable RapidOcrOnnx
/usr/bin/ld: /home/admin/ocr/RapidOcrOnnx/onnxruntime-static/linux/lib/libonnxruntime_common.a(env.cc.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [RapidOcrOnnx] Error 1
gmake[1]: *** [CMakeFiles/RapidOcrOnnx.dir/all] Error 2
gmake: *** [all] Error 2
~/ocr/RapidOcrOnnx
@benjaminwan
Copy link
Member

这是直接git clone 主线最新的代码吧,这还是折腾一半的代码。
请到release里下载Project_RapidOcrOnnx-1.1.3.7z

linux系统,如果碰到链接问题,需要重头自己编译onnxruntime和opencv,或改造工程的cmake改用动态库。

@mrbulb
Copy link
Author

mrbulb commented Oct 20, 2022

这是直接git clone 主线最新的代码吧,这还是折腾一半的代码。 请到release里下载Project_RapidOcrOnnx-1.1.3.7z

linux系统,如果碰到链接问题,需要重头自己编译onnxruntime和opencv,或改造工程的cmake改用动态库。

@benjaminwan 是的,我是直接编译 c08438d8ca81de2ba28533a542701e41cddd5ff6 c'm的代码的,我去试一下release版本

我用的ort和opencv是之前编译好的静态库,在别的代码里调用过,应该没问题。

还有想问您一下,这个release版本是只支持CPU吗:https://github.com/RapidAI/RapidOcrOnnx/releases/download/1.1.3/Project_RapidOcrOnnx-1.1.3.7z

@benjaminwan
Copy link
Member

支持cuda的v1.2.0已经发布,v1.1.3只支持cpu。

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

2 participants