Reputation: 211
I am wondering why I am getting error "string could not be resolved to type"
when I have the proper inclusions?
#ifndef EVENTFILEREADER_H_
#define EVENTFILEREADER_H_
#include <string>
#include <stdlib.h>
#include <iostream>
class EventFileReader {
public:
EventFileReader(string fileName);
virtual ~EventFileReader();
};
#endif /* EVENTFILEREADER_H_ */
Upvotes: 0
Views: 209
Reputation: 50667
Your compiler is complaining about not being able to find string
as a defined type.
You should add its namespace std
:
EventFileReader(std::string fileName);
^^^^^
Upvotes: 2
Reputation: 3325
You need to specify namespace, e.g.
std::string
or put the using declaration after includes:
using std::string;
Upvotes: 1