Borland C ++ Builder 6 - E2316 'vector' is not a member of 'std'

Reasonably new to C ++, I'm trying to use vectors in my application. I use

#include <vector>

in the header file, but when I compile it, it does not work on this line:

std::vector<Shot> shot_list;

Noting error E2316 'vector' is not a member of 'std'

If I remove std ::, it displays a compiler error message. Really at a loss with this. If there is no problem using

std::list<Shot> shot_list; 

before using vectors.

Here is a simple example that does not compile:

//---------------------------------------------------------------------------

#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

For me, I see no difference between this and this example

+3
source share
1 answer

, , "" . ( std;) , .

Edit:

.h. .cpp, , resize() . ( ):

    #ifndef testclassH
    #define testclassH
    //---------------------------------------------------------------------------
    #include <vector>
    class TestClass {

    private:
    std::vector<int> testVect;

    public:
    TestClass()
    {
        testVect.resize(4);
    }

    };

    #endif

, , .

+3

All Articles