------------------------------------------
#include <string>
#include <vector>
void main()
{
vector< string > iv1(4);
}
------------------------------------------
是VC的环境不对?还是……
18 个解决方案
#1
using namespace std;
#2
#include <string>
#include <vector>
using namespace std;
void main()
{
vector< string > iv1(4);
}
#include <vector>
using namespace std;
void main()
{
vector< string > iv1(4);
}
#3
yes.,using namespace std;
std::vector<string>
std::vector<string>
#4
以下warning是什么意思?是否可以不理会?
--------------------Configuration: Stack - Win32 Debug--------------------
Compiling...
main.cpp
e:\pf\vs\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D
@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(61) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?$basic_string@DU?$char_traits@D@
std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(103) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(105) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(107) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(108) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std
::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(47) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<cha
r,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
main.obj - 0 error(s), 10 warning(s)
--------------------Configuration: Stack - Win32 Debug--------------------
Compiling...
main.cpp
e:\pf\vs\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D
@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(61) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?$basic_string@DU?$char_traits@D@
std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(103) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(105) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(107) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(108) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std
::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(47) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<cha
r,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
main.obj - 0 error(s), 10 warning(s)
#5
消除这些警告可以用下面这个
#pragma warning(disable:4786)
让编译起来降低警告的级别!
#pragma warning(disable:4786)
让编译起来降低警告的级别!
#6
警告不用理,觉得碍眼的话就像楼上那样把这个警告关掉
#7
#include <string>
#include <vector>
#pragma warning(disable:4786)
using namespace std;
#include <vector>
#pragma warning(disable:4786)
using namespace std;
#8
to arvid_gs(west):
你的代码应该把#pragma行放在#include <vector>行之前,不然编译还是有warning,,对吧!
--------------------------------------------------
#include <string>
#pragma warning(disable:4786)
#include <vector>
using namespace std;
你的代码应该把#pragma行放在#include <vector>行之前,不然编译还是有warning,,对吧!
--------------------------------------------------
#include <string>
#pragma warning(disable:4786)
#include <vector>
using namespace std;
#9
参与!只看.
#10
你要安装STL,
然后打开VC++6.0,执行:tools->options,选择Directories栏,将D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\INCLUDE\STLPORT加入到“include files”中,并保证在D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE前,从而是STL的头文件被优先使用。
注意:使用STL的工程必须设定:Project->settings,然后选择C/C++选项,再选择Code Generation,在use real-time library栏中选择“Debug Multithreaded DLL”或“Multithreaded DLL”。
然后打开VC++6.0,执行:tools->options,选择Directories栏,将D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\INCLUDE\STLPORT加入到“include files”中,并保证在D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE前,从而是STL的头文件被优先使用。
注意:使用STL的工程必须设定:Project->settings,然后选择C/C++选项,再选择Code Generation,在use real-time library栏中选择“Debug Multithreaded DLL”或“Multithreaded DLL”。
#11
using namespace std;
或#include <string.h>
#include <vector.h>
.h是C的习惯用法
在C++中用using namespace std;
或#include <string.h>
#include <vector.h>
.h是C的习惯用法
在C++中用using namespace std;
#12
bluebohe(薄荷)
警告也不能忽视的,有些时候警告会比错误还另人头疼
警告也不能忽视的,有些时候警告会比错误还另人头疼
#13
to lkjx82(风化血)
我用#include <string.h>后,有3个error(s)
----------------------------------------------------
#include <string.h>
void main()
{
string a;
}
----------------------------------------------------
--------------------Configuration: test_bi - Win32 Debug--------------------
Compiling...
main.cpp
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'string' : undeclared identifier
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2146: syntax error : missing ';' before identifier 'a'
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'a' : undeclared identifier
Error executing cl.exe.
test_bi.exe - 3 error(s), 0 warning(s)
我用#include <string.h>后,有3个error(s)
----------------------------------------------------
#include <string.h>
void main()
{
string a;
}
----------------------------------------------------
--------------------Configuration: test_bi - Win32 Debug--------------------
Compiling...
main.cpp
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'string' : undeclared identifier
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2146: syntax error : missing ';' before identifier 'a'
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'a' : undeclared identifier
Error executing cl.exe.
test_bi.exe - 3 error(s), 0 warning(s)
#14
to: ppzcgg(排排坐,吃果果)
怎么安装STL啊,哪里有安装程序啊,我在网上搜不到,是不是我装好STL,不用using namespace std;就可以编译通过了?
怎么安装STL啊,哪里有安装程序啊,我在网上搜不到,是不是我装好STL,不用using namespace std;就可以编译通过了?
#15
各帮助我解决问题的朋友,抱歉此帖还没结帖,请大家再等一会儿,我想把我能看到的每一个问题都搞明白
因为有数位朋友都给了我相应的不同的知识点,所以在结帖的时候,我会再加一些分数然后再结帐,谢谢!!!
因为有数位朋友都给了我相应的不同的知识点,所以在结帖的时候,我会再加一些分数然后再结帐,谢谢!!!
#16
gz
#17
没人回答我就只有结帖了……
akiko(弥弥)第一个回帖正确,但回得不详细,我这个新手不知道你这句话是什么意思,反而bluebohe(薄荷)写的我一看就明白,所以akiko(弥弥)得10。bluebohe(薄荷)得10。NewFree(新*人) 也给了我一个差不多忘记了的知识点,得10。vcforever(霓裳羽衣)给了我一个新知识点,得10。ppzcgg(排排坐,吃果果)给的我不知道对不对,也没回来再给我解决问题,所以只好得5
再次,多谢兄弟们!
akiko(弥弥)第一个回帖正确,但回得不详细,我这个新手不知道你这句话是什么意思,反而bluebohe(薄荷)写的我一看就明白,所以akiko(弥弥)得10。bluebohe(薄荷)得10。NewFree(新*人) 也给了我一个差不多忘记了的知识点,得10。vcforever(霓裳羽衣)给了我一个新知识点,得10。ppzcgg(排排坐,吃果果)给的我不知道对不对,也没回来再给我解决问题,所以只好得5
再次,多谢兄弟们!
#18
呵呵
#1
using namespace std;
#2
#include <string>
#include <vector>
using namespace std;
void main()
{
vector< string > iv1(4);
}
#include <vector>
using namespace std;
void main()
{
vector< string > iv1(4);
}
#3
yes.,using namespace std;
std::vector<string>
std::vector<string>
#4
以下warning是什么意思?是否可以不理会?
--------------------Configuration: Stack - Win32 Debug--------------------
Compiling...
main.cpp
e:\pf\vs\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D
@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(61) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?$basic_string@DU?$char_traits@D@
std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(103) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(105) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(107) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(108) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std
::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(47) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<cha
r,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
main.obj - 0 error(s), 10 warning(s)
--------------------Configuration: Stack - Win32 Debug--------------------
Compiling...
main.cpp
e:\pf\vs\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D
@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(61) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?$basic_string@DU?$char_traits@D@
std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(103) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(105) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(107) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
e:\pf\vs\vc98\include\vector(108) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_
string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(9) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
F:\xlee\SourceCode\_VC6\Stack\main.cpp(11) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std
::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(47) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<cha
r,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
e:\pf\vs\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<ch
ar,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
main.obj - 0 error(s), 10 warning(s)
#5
消除这些警告可以用下面这个
#pragma warning(disable:4786)
让编译起来降低警告的级别!
#pragma warning(disable:4786)
让编译起来降低警告的级别!
#6
警告不用理,觉得碍眼的话就像楼上那样把这个警告关掉
#7
#include <string>
#include <vector>
#pragma warning(disable:4786)
using namespace std;
#include <vector>
#pragma warning(disable:4786)
using namespace std;
#8
to arvid_gs(west):
你的代码应该把#pragma行放在#include <vector>行之前,不然编译还是有warning,,对吧!
--------------------------------------------------
#include <string>
#pragma warning(disable:4786)
#include <vector>
using namespace std;
你的代码应该把#pragma行放在#include <vector>行之前,不然编译还是有warning,,对吧!
--------------------------------------------------
#include <string>
#pragma warning(disable:4786)
#include <vector>
using namespace std;
#9
参与!只看.
#10
你要安装STL,
然后打开VC++6.0,执行:tools->options,选择Directories栏,将D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\INCLUDE\STLPORT加入到“include files”中,并保证在D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE前,从而是STL的头文件被优先使用。
注意:使用STL的工程必须设定:Project->settings,然后选择C/C++选项,再选择Code Generation,在use real-time library栏中选择“Debug Multithreaded DLL”或“Multithreaded DLL”。
然后打开VC++6.0,执行:tools->options,选择Directories栏,将D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\INCLUDE\STLPORT加入到“include files”中,并保证在D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE前,从而是STL的头文件被优先使用。
注意:使用STL的工程必须设定:Project->settings,然后选择C/C++选项,再选择Code Generation,在use real-time library栏中选择“Debug Multithreaded DLL”或“Multithreaded DLL”。
#11
using namespace std;
或#include <string.h>
#include <vector.h>
.h是C的习惯用法
在C++中用using namespace std;
或#include <string.h>
#include <vector.h>
.h是C的习惯用法
在C++中用using namespace std;
#12
bluebohe(薄荷)
警告也不能忽视的,有些时候警告会比错误还另人头疼
警告也不能忽视的,有些时候警告会比错误还另人头疼
#13
to lkjx82(风化血)
我用#include <string.h>后,有3个error(s)
----------------------------------------------------
#include <string.h>
void main()
{
string a;
}
----------------------------------------------------
--------------------Configuration: test_bi - Win32 Debug--------------------
Compiling...
main.cpp
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'string' : undeclared identifier
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2146: syntax error : missing ';' before identifier 'a'
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'a' : undeclared identifier
Error executing cl.exe.
test_bi.exe - 3 error(s), 0 warning(s)
我用#include <string.h>后,有3个error(s)
----------------------------------------------------
#include <string.h>
void main()
{
string a;
}
----------------------------------------------------
--------------------Configuration: test_bi - Win32 Debug--------------------
Compiling...
main.cpp
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'string' : undeclared identifier
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2146: syntax error : missing ';' before identifier 'a'
F:\xlee\SourceCode\_VC6\test_bi\main.cpp(8) : error C2065: 'a' : undeclared identifier
Error executing cl.exe.
test_bi.exe - 3 error(s), 0 warning(s)
#14
to: ppzcgg(排排坐,吃果果)
怎么安装STL啊,哪里有安装程序啊,我在网上搜不到,是不是我装好STL,不用using namespace std;就可以编译通过了?
怎么安装STL啊,哪里有安装程序啊,我在网上搜不到,是不是我装好STL,不用using namespace std;就可以编译通过了?
#15
各帮助我解决问题的朋友,抱歉此帖还没结帖,请大家再等一会儿,我想把我能看到的每一个问题都搞明白
因为有数位朋友都给了我相应的不同的知识点,所以在结帖的时候,我会再加一些分数然后再结帐,谢谢!!!
因为有数位朋友都给了我相应的不同的知识点,所以在结帖的时候,我会再加一些分数然后再结帐,谢谢!!!
#16
gz
#17
没人回答我就只有结帖了……
akiko(弥弥)第一个回帖正确,但回得不详细,我这个新手不知道你这句话是什么意思,反而bluebohe(薄荷)写的我一看就明白,所以akiko(弥弥)得10。bluebohe(薄荷)得10。NewFree(新*人) 也给了我一个差不多忘记了的知识点,得10。vcforever(霓裳羽衣)给了我一个新知识点,得10。ppzcgg(排排坐,吃果果)给的我不知道对不对,也没回来再给我解决问题,所以只好得5
再次,多谢兄弟们!
akiko(弥弥)第一个回帖正确,但回得不详细,我这个新手不知道你这句话是什么意思,反而bluebohe(薄荷)写的我一看就明白,所以akiko(弥弥)得10。bluebohe(薄荷)得10。NewFree(新*人) 也给了我一个差不多忘记了的知识点,得10。vcforever(霓裳羽衣)给了我一个新知识点,得10。ppzcgg(排排坐,吃果果)给的我不知道对不对,也没回来再给我解决问题,所以只好得5
再次,多谢兄弟们!
#18
呵呵