mercredi 1 avril 2015

error: ‘list’ is not a member of ‘std’

I'm trying to compile my header file, but I'm getting errors I can't figure out.


I want to create a struct that contains 3 maps: -map from single words to counts -map from word pairs to counts -map from single words to list of following words


The code in my header file:



#include <cstdlib>
#include <iostream>
#include <cstring>
#include <string>
#include <cctype>
#include <vector>
#include <algorithm>
#include <map>


typedef struct {

std::map<std::string, int> firstCounts;

std::map<std::string, int> pairCounts;

std::map<std::string, std::list<std::string>> follows; //You can use an iterator to retrieve the values stored in the list.

} LanguageModel;


And the errors I'm getting:



LangModel.h:24:23: error: ‘list’ is not a member of ‘std’
std::map<std::string, std::list<std::string>> follows; //You can use an iterator to retrieve the values stored in the list.
^
LangModel.h:24:23: error: ‘list’ is not a member of ‘std’
LangModel.h:24:38: error: template argument 2 is invalid
std::map<std::string, std::list<std::string>> follows; //You can use an iterator to retrieve the values stored in the list.
^
LangModel.h:24:38: error: template argument 4 is invalid
LangModel.h:24:44: error: expected unqualified-id before ‘>’ token
std::map<std::string, std::list<std::string>> follows; //You can use an iterator to retrieve the values stored in the list.

Aucun commentaire:

Enregistrer un commentaire