今天在vc6.0中使用了map,在map中嵌套了vector,错误报错了error C2143: syntax error : missing '>' before ';'错误,但是同样的代码,在vs2005中却不会报错,浪费了我很长时间,解决方案如下,希望对其他遇到同样的朋友有所帮助
编译环境VC6.0
程序如下:
#include<vector>
#include<map>
#include<iostream>
int main()
{
std::map<int,std::vector<int>>;
return 0;
}
提示下面错误:
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
main.cpp
D:\Program Files\Microsoft Visual Studio\MyProjects\test\main.cpp(7) : error C2143: syntax error : missing '>' before ';'
Error executing cl.exe.
main.obj - 1 error(s), 0 warning(s)
错误解决:
将 std::map<int,std::vector<int>>; 修改为std::map<int,std::vector<int> >;
注意:vector<int>后面加了一个空格
在vs2005中不会报错,可能是由于vc6.0和vs2005的编译器不一样的缘故吧。
分享到:
相关推荐
e:\newpaintgraph\newpaintgraph\newpaintgraphview.h(23) : error C2143: syntax error : missing ';' before '*' e:\newpaintgraph\newpaintgraph\newpaintgraphview.h(23) : error C2501: 'CNewPaintGraphDoc' : ...
e:\test\testview.h(21) : error C2143: syntax error : missing ';' before '*' e:\test\testview.h(21) : error C2501: 'CTestDoc' : missing storage-class or type specifiers e:\test\testview.h(21) : error C...
其实,这是一个非常容易解决掉的问题。在我看来,似曾相识,呵呵,最近学JavaScript...Parse error: syntax error, unexpected T_VAR in D:\Apache2.2\htdocs\shirdrn\page\p2\pageUtil.inc on line 34 我在测试:在
python——pip install xxx报错SyntaxError: invalid syntax 在安装好python后,进入python运行环境后,因为我要用pip安装开发Web App需要的第三方库,执行pip install aiohttp,发现会报错SyntaxError: invalid ...
JS错误Uncaught SyntaxError: Cannot use import statement outside a module< 分析及解决方法 错误信息: 错误分析: HTML 网页中,浏览器通过 script 标签加载 JavaScript 脚本。由于浏览器脚本的默认语言是 ...
今天帮客户配置服务器,访问php的时候提示PHP Parse Error: syntax error, unexpected $end 错误,通过查找找到了问题,特分享下
您可能感兴趣的文章:php中try catch捕获异常实例详解PHP异常Parse error: syntax error, unexpected T_VAR错误解决方法PHP的异常处理类Exception的使用及说明php Try Catch异常测试PHP如何抛出异常处理错误php中...
二、开启入口文件时,提示以下错误 `basedir=$(dirname $(echo $0 | sed -e 's,\\,/,g') SyntaxError: missing......` 三、解决办法,因为使用了express框架,需要安装 express 即可 npm install express --save-...
Ruby Quick Syntax Reference.pdf Ruby速查手册,Ruby这语言听起来就很酷! 英文PDF版本,欢迎下载!
今天在写PHP程序的时候总是出现这样的错误:Parse error: syntax error, unexpected end of file in *.php on line *,然后我就根据提示,找到那个文件,然后错误中总是提示最后一行出错,我找到最后一行发现是<...
同事在使用python3操作sqlite时出现了异常,具体代码缩减如下: import sqlite3 conn = sqlite3.connect('star.db') cursor = conn.cursor() insert_sql = 'insert into user(id,name) values (%s,%s)' cursor....
CentOS 7运行.sh脚本提示syntax error: unexpected end of file。脚本是通过本地电脑的notepad++编辑之后用ftp上传到CentOS 7服务器上的。 错误原因: shell脚本在本地电脑编辑的,格式是dos(可以用vi编辑该shell...
本文实例讲述了JS提示:Uncaught SyntaxError: Unexpected token ILLEGAL错误的解决方法。分享给大家供大家参考,具体如下: Uncaught SyntaxError: Unexpected token ILLEGAL 未捕获的语法错误: 意想不到的非法...
关于pip install xxx报错SyntaxError:invalid syntax的解决方法 声明:1.以下均以pip install requests举例; 2.Windows系统; 首先,看自己是否在python环境中运行了pip,若是,请打开“开始”菜单,输入cmd,找到...
Python错误: SyntaxError: Non-ASCII character解决办法 (1)问题描述 在写Python代码的过程中,有用到需要输出中文的地方,但是运行后发现上述错误。SyntaxError: Non-ASCII character ‘\xe4’ in file ./...
c:\wpdpack\include\pcap-stdinc.h(79) : error C2144: syntax error : missing ';' before type 'unsigned int' c:\wpdpack\include\pcap-stdinc.h(79) : fatal error C1004: unexpected end of file found
unity 打包web包报错:Uncaught SyntaxError: Unexpected token '在打包文件添加此配置文件。 <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> ...
PHP会出现eval()'d code error 错误提示的原因一般都是因为模板错误,原因有以下几种情况