本文主要是介绍centos7 Qt5.9.1 opencv静态库报grfmt_exr.cpp错误,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
错误:
grfmt_exr.cpp:-1: error: undefined reference to `Imf::Chromaticities::Chromaticities(Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&)'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::globalThreadCount()'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::InputFile::InputFile(char const*, int)'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::Header::dataWindow() const'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::hasChromaticities(Imf::Header const&)'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::InputFile::header() const'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::Header::channels() const'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::ChannelList::findChannel(char const*) const'
grfmt_exr.cpp:-1: error: undefined reference to `Imf::ChannelList::findChannel(char const*) const'
1.centos7 编译opencv2.4.13静态库的方法参考:http://blog.csdn.net/sz76211822/article/details/75592973
2.环境配置:
2.1在终端里面输入 locate libIlmImf
将libIlmImf.a 拷贝出来。如下面的“工程目录”
2.2将opencv Include文件夹以及静态库从 /usr/local/lib 拷贝出来.
工程目录:
静态库目录:
3.Qt5.9.1 配置Opencv静态库
INCLUDEPATH += -L$$PWD ./Opencv/include \-L$$PWD ./Opencv/include/opencv \-L$$PWD ./Opencv/include/opencv2 \LIBS +=-ljpeg \
-lpng \
-ljasper \
-ltiff \
-ldl \
-lz \
$${PWD}/Include/Sqlite3/libsqlite3.a \
$${PWD}/Include/Opencv/lib/libopencv_core.a \
$${PWD}/Include/Opencv/lib/libopencv_highgui.a \
$${PWD}/Include/Opencv/lib/libopencv_imgproc.a \
$${PWD}/Include/Opencv/lib/libIlmImf.a \
重新编译,错误就没有了
这篇关于centos7 Qt5.9.1 opencv静态库报grfmt_exr.cpp错误的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!