I'm running into a syntax/parsing error, but I can't seem to locate it.
DataReader.h:11: error: expected constructor, destructor, or type conversion before '<' token
Here is DataReader.h:
#include <fstream>
#include <iostream>
#include <vector>
#ifndef DATA_H
#define DATA_H
#include "Data.h"
#endif
vector<Data*> DataReader(); // This is line 11, where the error is..
And this is the .cpp file:
#include "DataReader.h"
using namespace std;
vector<Data*> DataReader()
{
.....
}
I skipped the content of DataReader() because I think it's irrelevant, but I can post it if needed.
Thanks for any input/suggestions.
In your header file, you need to explicitly use std::vector
rather than just vector
.
Also, I'm guessing that "Data.h" contains statements of the form:
#ifndef DATA_H
#define DATA_H
...
#endif
That's fine, but you should not use these include guards across #include "Data.h"
as well, only within the file itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With