the previous version didn't even link to libhdf5_cpp.sopull/12027/head
parent
0c2b616183
commit
c2ed846b64
1 changed files with 9 additions and 19 deletions
@ -1,29 +1,19 @@ |
||||
#include <iostream> |
||||
#include "hdf5.h" |
||||
#include "H5Cpp.h" |
||||
|
||||
|
||||
int main(void) |
||||
{ |
||||
herr_t ier; |
||||
unsigned maj, min, rel; |
||||
|
||||
ier = H5open(); |
||||
if (ier) { |
||||
std::cerr << "Unable to initialize HDF5: " << ier << std::endl; |
||||
try { |
||||
H5::H5Library::open(); |
||||
H5::H5Library::getLibVersion(maj, min, rel); |
||||
std::cout << "C++ HDF5 version " << maj << "." << min << "." << rel << std::endl; |
||||
H5::H5Library::close(); |
||||
return EXIT_SUCCESS; |
||||
} catch (H5::LibraryIException &e) { |
||||
std::cerr << "Exception caught from HDF5: " << e.getDetailMsg() << std::endl; |
||||
return EXIT_FAILURE; |
||||
} |
||||
|
||||
ier = H5get_libversion(&maj, &min, &rel); |
||||
if (ier) { |
||||
std::cerr << "HDF5 did not initialize!" << std::endl; |
||||
return EXIT_FAILURE; |
||||
} |
||||
std::cout << "C++ HDF5 version " << maj << "." << min << "." << rel << std::endl; |
||||
|
||||
ier = H5close(); |
||||
if (ier) { |
||||
std::cerr << "Unable to close HDF5: " << ier << std::endl; |
||||
return EXIT_FAILURE; |
||||
} |
||||
return EXIT_SUCCESS; |
||||
} |
||||
|
Loading…
Reference in new issue