2D vector of strings


I am having a very strange problem where some custom c++ classes have started to throw up problems (where they worked absolutely fine and as expected for the past 3 years).

Within the class in question, I define in the header file both 1D and 2D vectors of strings as:

typedef std::vector<std::string> stringVector;
typedef std::vector<std::vector<std::string> > stringMatrix;

I am trying to read data from a text file using these objects. I am attempting to use them in the following way:

stringMatrix m;

stringVector s;

// Initialise s


This gives me the following error:

Error: Can’t call vector<vector<string,allocator >,allocator<vector<string,allocator > > >::push_back(mDataLine)

Where mDataLine is of type stringVector

I am extremely puzzled as to why this error is being shown to me now, after seemingly working with no problems whatsoever for 3 years since I first wrote the class. In fact I had not edited the header or definition files for over a year, but apparently now through some black magic it does not work.

I am assuming perhaps something has become corrupted somewhere in the cstdlib? This class still seems to work on a different machine using the same ROOT version (5.34/32).

I attempted to rebuild root but this has not solved the problem. Any suggestions?


Okay so I have gathered that this is no ‘black magic’, but seems to be some problem with somehow vector being redefined as a result of me loading a shared library object.

I am still confused about how this can happen, as the library in question does not deal with std::vector other than to use it in its normal way.

If anyone can offer an explanation I would be keen to hear it

In v5, you need to have a dictionary for all STL collection used on the command prompt. the 2D vector of string is not one of the collection for which we provide a dictionary by default.