Pregunta

I am trying to recompile source code of an old game, which was not coded by me and I've no idea which compiler was used to compile this.
I am getting undefined identifier errors in a file which I couldn't figure out. The errors are like this -

Error : Undefined identifier 'begin'  
Error : Undefined identifier 'capacity'  
Error : Undefined identifier 'size'  
Error : Undefined identifier 'back'  
Error : Undefined identifier 'pop_back'  

I am pretty sure I am missing one or two header files. Any idea which headers I am missing there?
PS: I am using CodeWarrior IDE, if that helps.

Edit: -

Here're the code lines which are giving errors -

const OzU32 nCapacity = OzU32(capacity());
const OzU32 nAllocated = Capacity() - OzU32(size());
std::transform(
            m_pPoolMemory, 
            m_pPoolMemory + nCapacity, 
            begin(), 
            std::ptr_fun(SetPointer<Type>));
¿Fue útil?

Solución 2

Actually there were some other header files, which have the same method names, causing the compiler confusion. So I just added the vector namespace in front of the method name to work it out. Like this -

vector<Type>::begin()

And yeah it was vector.

Otros consejos

It looks like your compiler is either missing some of the standard library or hasn't been installed/configured properly.

You can either:

  1. Fix the compiler's configuration (particularly check the include paths)

  2. Switch to a different compiler

  3. Install a third party version of the missing library (look at stlport)

  4. Replace the code in the program you are working on which use the missing library classes

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top