VC++中如何使用stl,为什么声明连编译也通不过? example:pragma warning(disable:4786)#include <iostream>#include <string>#include <map>using namespace std; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 pragma warning(disable:4786)#include <iostream>#include <string>#include <map>#include <list>using namespace std; pragma warning(disable:4786)using namespace std;是什么意思?必须加吗? 还是不对:--------------------Configuration: CodeCom - Win32 Debug--------------------Compiling...CodeCounter.cppd:\codecounter\codecom\codecounter.h(11) : error C2146: syntax error : missing ';' before identifier 'warning'd:\codecounter\codecom\codecounter.h(11) : error C2501: 'pragma' : missing storage-class or type specifiersd:\codecounter\codecom\codecounter.h(11) : fatal error C1004: unexpected end of file foundError executing cl.exe.CodeCom.dll - 3 error(s), 0 warning(s) pragma warning(disable:4786)//使用stl会出现大量的4786警告,最好不要显示using namespace std;//所用的变量均在名字空间std中定义 sorryshould be #pragma warning(disable:4786) 还是有同样的错误:--------------------Configuration: CodeCom - Win32 Debug--------------------Compiling...CodeCounter.cppd:\codecounter\codecom\codecounter.h(47) : error C2143: syntax error : missing ';' before '<'d:\codecounter\codecom\codecounter.h(47) : error C2501: 'list' : missing storage-class or type specifiersd:\codecounter\codecom\codecounter.h(47) : error C2059: syntax error : '<'d:\codecounter\codecom\codecounter.h(47) : error C2238: unexpected token(s) preceding ';'Error executing cl.exe.CodeCom.dll - 4 error(s), 0 warning(s) list <int> m_listIndex; //test. 你是不是把“#include <list>”写成“#include <list.h>”了? 这莫非是传说中的反射? 祝各位坛里的水友们五一节日快乐! 请高手指点一下用VC开发GIS需要做哪些工作,谢谢 关于随机的问题(VC++6。0) 控件中相应快捷建的问题 请问我这样向数据库中插入数据,调试时老是在m_courseset->Open();报错,程序是。。。 关于串口通信问题!急!!!!200分送 有没有支持f5和f10的汇编工具?我用masm,感觉不爽. 我遇到几个怪问题,哪位高手帮帮我?我快要疯了!!!!! 如何从com里传入传出unsigned char *值? 哪有<<Essential C++>>的电子版?高分! 谁能给个简单传奇外挂的实现
#include <string>
#include <map>
#include <list>using namespace std;
using namespace std;
是什么意思?
必须加吗?
--------------------Configuration: CodeCom - Win32 Debug--------------------
Compiling...
CodeCounter.cpp
d:\codecounter\codecom\codecounter.h(11) : error C2146: syntax error : missing ';' before identifier 'warning'
d:\codecounter\codecom\codecounter.h(11) : error C2501: 'pragma' : missing storage-class or type specifiers
d:\codecounter\codecom\codecounter.h(11) : fatal error C1004: unexpected end of file found
Error executing cl.exe.CodeCom.dll - 3 error(s), 0 warning(s)
using namespace std;//所用的变量均在名字空间std中定义
#pragma warning(disable:4786)
--------------------Configuration: CodeCom - Win32 Debug--------------------
Compiling...
CodeCounter.cpp
d:\codecounter\codecom\codecounter.h(47) : error C2143: syntax error : missing ';' before '<'
d:\codecounter\codecom\codecounter.h(47) : error C2501: 'list' : missing storage-class or type specifiers
d:\codecounter\codecom\codecounter.h(47) : error C2059: syntax error : '<'
d:\codecounter\codecom\codecounter.h(47) : error C2238: unexpected token(s) preceding ';'
Error executing cl.exe.CodeCom.dll - 4 error(s), 0 warning(s)