Btw it is really weird... As everybody noted that main is structured in blocks so I tried to gradually comment those blocks to see where the error lays... Well the answer is in this part: { GMNLFS::DataAnalysis<vector<double>::iterator,double> llsAnalysis(lls.begin(),lls.end());