#include <QVector>
#include <QString>
QVector<QString> vector;
vector.append("sometext");
If this is your real code, then you are doing the append
outside of any function, which you can't do in c++, and which will cause the exact compilation error you mentioned: