I've the header file in which I declare some constants with extern:
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include <string>
class Constants
{
public:
Constants(){}
extern const std::string DELIMITER;
extern const std::string FILENAME;
extern const int BLUCAR;
extern const int REDCAR;
extern const int EMPTY;
extern const int SPARSE_LIM;
protected:
private:
};
#endif // CONSTANTS_H
Then in the source I define them like this:
#include "constants.h"
extern const std::string DELIMITER = ",";
extern const std::string FILENAME = "cars.csv";
extern const int BLUCAR = 1;
extern const int REDCAR = 2;
extern const int EMPTY = 0;
extern const int SPARSE_LIM = 5;
Why the compiler gives me Error: storage class specified for 'DELIMITER'?