-
Notifications
You must be signed in to change notification settings - Fork 437
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
undefined reference to `cv::imwrite #206
Comments
需要通过-L将lib路径加进来 建议参考example目录下的示例使用cmake |
参考了:FastDeploy/examples/vision/classification/paddleclas/cpp/README.md 这里的例子,同样也遇到了问题:1. https://bj.bcebos.com/paddlehub/fastdeploy/libs/0.2.0/fastdeploy-linux-x64-gpu-0.2.0.tgz 地址失效,换成https://bj.bcebos.com/fastdeploy/release/cpp/fastdeploy-linux-x64-0.2.0.tgz 可以解决,2.跑 ./infer_demo ResNet50_vd_infer ILSVRC2012_val_00000010.jpeg 0 的时候 会报错./infer_demo: error while loading shared libraries: libpaddle2onnx.so.1.0.0rc3: cannot open shared object file: No such file or directory |
@xwang365 Hi,谢谢你的反馈,这页文档地址先前确实写错了,已修改。 Linux下编译生成二进制后,如果执行出现上面的问题,属于库没找到的问题,你可以试下把库加到LD_LIBRARY_PATH中执行
通过如上方式,将FastDeploy中的库路径添加好,即可执行。 |
此ISSUE由于一年未更新,将会关闭处理,如有需要,可再次更新打开。 |
尝试跑C++ 推理示例 报错
gcc demo.cpp
-I./FastDeploy/build/fastdeploy-0.0.3/include/
-I./FastDeploy/build/fastdeploy-0.0.3/third_libs/install/opencv/include/
-I./FastDeploy/build/third_libs/install/opencv/include/
-lfastdeploy
-lopencv_core
-lstdc++
-ldl
-o demo.so \
/usr/bin/ld: /tmp/ccxAZsgp.o: in function
main': demo.cpp:(.text+0x1b1): undefined reference to
cv::imread(cv::String const&, int)'/usr/bin/ld: demo.cpp:(.text+0x2a0): undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: demo.so] Error 1
The text was updated successfully, but these errors were encountered: