//allocate entities
entities = (cEntity*)malloc(sizeof(cEntity) * numEnts);
//load entities
for(unsigned int i = 0; i < numEnts; i++)
{
getline(in,str);
entities = new cEntity(str);
}
Basically that code snipet is where its reading the names of the entites from the file and then it loads them. cEntity.h
class cEntity
{
public:
cEntity(std::string filename); // filename to charset
~cEntity();
cEntity& operator=(cEntity const&);
};
thats not the whole class but its all you really need to know. cEntity.cpp
cEntity& cEntity::operator=(cEntity const& newEntity)
{
return *this;
}
theres my operator from the entity. Ok so now you have enough information (hopefully) to help with this problem. During compilation (g++ under linux) I get the following error. g++ -c engine/cMap.cpp -I/usr/include/SDL -O2 -pipe -Wall -ansi -o engine/cMap.o engine/cMap.cpp: In member function `void cMap::loadMap(char*)': engine/cMap.cpp:91: error: no match for 'operator=' in '*(((cMap*)this)->cMap::entities + (+(i * 60u))) = (string(((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)(&str)))), (((cEntity*)operator new(60u)), (<anonymous>->cEntity::cEntity(<anonymous>), <anonymous>)))' engine/cEntity.h:30: note: candidates are: cEntity& cEntity::operator=(const cEntity&) make: *** [engine/cMap.o] Error 1 If you need more code/information then tell me and I will post it. Thanks for the help. -Seoushi Fruny - Don't put extra-long lines in
blocks. Use <tt>...</tt> instead.