3
对于C++来说,合理的新手,我试图在我的应用程序中使用向量。 我使用Borland C++ Builder 6 - E2316'vector'不是'std'的成员
#include <vector>
在头文件
,但是当我编译它在这条线失败:
std::vector<Shot> shot_list;
注意到错误E2316“载体”不是“STD”
的成员如果我然后删除std ::,它导致未定义的符号'向量'编译器错误消息。真的在这一个损失。在使用载体之前没有使用的问题
std::list<Shot> shot_list;
。
下面是一个简单的例子,不能comile:
//---------------------------------------------------------------------------
#ifndef testclassH
#define testclassH
//---------------------------------------------------------------------------
#include <vector>
class TestClass {
private:
std::vector<int> testVect(1); // removing std:: and adding using namespace std; below the include for the vector it still fails to compile;
};
#endif
要我,我不看到这一点,This Example
您对'testVect'的声明是错误的。摆脱'(1)'部分,它应该只是'std :: vector testVect;'本身。 –
2012-05-02 22:21:00