C ++ HDF5找不到-lhdf5d [英] C++ HDF5 cannot find -lhdf5d
本文介绍了C ++ HDF5找不到-lhdf5d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
情况:我想创建一个程序来读取 .hdf5
文件中的内容.
Situation: I want to create a program to read something from a .hdf5
file.
我做了什么:什么都没有,只是将 hdf5.lib
添加到项目中.
What i did: Nothing, but adding the hdf5.lib
to the project.
问题:
我遇到两个错误
当我尝试运行程序时.
cannot find -lhdf5d
error: ld returned 1 exit status
我的代码:
HDF5_Test.pro
:
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += \
main.cpp
win32:CONFIG(release, debug|release): LIBS += -L'C:/Program Files/HDF_Group/HDF5/1.10.2/lib/' -lhdf5
else:win32:CONFIG(debug, debug|release): LIBS += -L'C:/Program Files/HDF_Group/HDF5/1.10.2/lib/' -lhdf5d
else:unix: LIBS += -L'C:/Program Files/HDF_Group/HDF5/1.10.2/lib/' -lhdf5
INCLUDEPATH += 'C:/Program Files/HDF_Group/HDF5/1.10.2/include'
DEPENDPATH += 'C:/Program Files/HDF_Group/HDF5/1.10.2/include'
main.cpp
:
#define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG //this is needed to avoid redefinition conflict of ssize_t (Qt vs HDF5)
#include <hdf5.h>
#include <H5Cpp.h> //Tried with and without this include
int main()
{
return 0;
}
使用:
- C ++
- Qt 5.10.1
- MinGW 32位
- HDF5 1.10.2
- Windows 7
在另一个项目中,无论出于何种原因,这些错误都不会发生,而是这些错误.
In another project for whatever reason these Errors doesn't occur, but these.
.
推荐答案
解决方案是我删除此行中的最后一个"d":
The Solution was for me to delete the final "d" in this line:
else:win32:CONFIG(debug, debug|release): LIBS += -L'C:/Program Files/HDF_Group/HDF5/1.10.2/lib/' -lhdf5d
意思是我将 -lhdf5d
更改为 -lhdf5
.
这篇关于C ++ HDF5找不到-lhdf5d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文