(C++) Size of @\STL@%vector%78\STL@... is unknown or zero
January 9, 2018 · View on GitHub
(C++) Size of @_STL@%vector%78_STL@... is unknown or zero
Full error message
[C++ Error] Size of @_STL@%vector%78_STL@%pair\$63_STL@%basic_string$c20_STL@char_traits$c%18_STL@allocator$c%%i%97_STL@%allocator\$78_STL@$pair\$63_STL@%basic_string$c20_STL@ is unknown or zero
Cause
IDE: C++ Builder 6.0
Compiler: Borland BCC32.EXE version 6.0.10.157
Project type: Console Application
Libraries used:
- STL: version supplied with C++ Builder 6.0
Source code
struct MyForm : public TForm { void std::vector<std::pair<std::string,int> > question_scores; };
The cause is that the member variable question_scores is of type 'std::vector<std::pair<std::string,int> >', instead of 'void std::vector<std::pair<std::string,int> >' (void is used erroneously).
Solution
struct MyForm : public TForm { std::vector<std::pair<std::string,int> > question_scores; };