Skip to content
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

Wiki example error #2

Open
nyckmaia opened this issue Oct 17, 2019 · 0 comments
Open

Wiki example error #2

nyckmaia opened this issue Oct 17, 2019 · 0 comments

Comments

@nyckmaia
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant