我有一个在 ubuntu linux vmPlayer 上工作的 flex-bison 项目。问题是,我试图在我的野牛文件中使用字符串和 int 的映射进行 int-string 转换,它在文件 extra.y 中给了我错误:
%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <map>
using namespace std;
int yylex();
void yyerror(const char*);
map<string,int> vars; //ERROR
它给我的错误:
extra.y:9:12: error: ‘string’ was not declared in this scope
map<string,int> vars;
..帮助 ??