Defining a struct in flex error C++

Both vector and string are in the std namespace so you should add it to the declaration of member variables of those types. Change the code to: EDIT: (thanks to Kerrek SB): also you can not define a vector of Node as a member of Node. Instead use a vector of pointers to node like so: std::vector<Node*> vecini[];