hdf5
hdf5 copied to clipboard
Wiki example error
I copy and paste your Wiki example and I did a little adaptation to use it on a new Qt Console application.
#include <QCoreApplication>
#include <hdffile.hpp>
#include <hdfdataset.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
hdf::HDFFile<> file("test.h5", hdf::HDFFile<>::truncate);
std::vector<double> data(100,1.0);
std::shared_ptr<hdf::HDFDataSet<> > dataset =
file.writeDataset<double>("doubledataset", data);
return a.exec();
}
In this line:
std::shared_ptr<hdf::HDFDataSet<> > dataset =
file.writeDataset<double>("doubledataset", data);
I got these 2 errors:
error: C++ requires a type specifier for all declarations
error: expected '(' for function-style cast or type construction
What I have to do?