Pixel Perfect
Member
|
Variable declaration mistaken for function in ES
I have another compilation issue where a variable definition is being mistaken for a function and added to the function definitions in the header file.
Note: I intend changing the STL containers for the Esenthel equivalents but only once I have my existing code fully working.
main.cpp
Code:
std::map<std::string, npc*> m_mapNPCList;
std::map<std::string, npc*>::iterator m_mapNPCListIter;
This gets generated in main.h
Code:
/******************************************************************************/
// FUNCTIONS
/******************************************************************************/
std::map<std::string, npc*>::iterator m_mapNPCListIter;
void updateStepGameLogic(void);
void initializeEKIOne(void);
void updateEKIOne(void);
void handleEKIMessages(void);
void shutdownEKIOne(void);
void createEntityFromEKIMessage(const EKI_One::SystemMessage&, bool createAsAgent);
void setCurrentAnimation(const EKI_One::SystemMessage&);
SkyColor Lerp(C SkyColor &a, C SkyColor &b, flt frac);
...
which causes the following error:
Quote:1>main.cpp
1>c:\users\ian\documents\esenthel 2.0\projects\_build_\kingdom of soul\source\main.cpp(31) : error C2086: 'std::_Tree<_Traits>::iterator m_mapNPCListIter' : redefinition
|
|
08-19-2013 07:49 PM |
|
kasinova
Member
|
RE: Variable declaration mistaken for function in ES
it does look like you are defining npc list twice.
use an extern in your header file and do the declaring in the source :]
|
|
08-19-2013 08:14 PM |
|
Pixel Perfect
Member
|
RE: Variable declaration mistaken for function in ES
Thanks for the comments kasinova, but I don't have a header file. This header is being entirely generated by Esenthel and the issue appears to be that it thinks the iterator definition is a function and as such is adding a function prototype to the header.
I thought there was no need for headers when using ES as it generates the headers automatically, at least that had been my understanding so far.
|
|
08-19-2013 08:42 PM |
|
kasinova
Member
|
RE: Variable declaration mistaken for function in ES
Oh as far as ES I wouldn't know lol :[ I use VS 2012 and so I write out all of my headers.
I'm AFK right now but couldn't you define your iterator from m_mapNPClist?
|
|
08-20-2013 01:28 AM |
|
Pixel Perfect
Member
|
RE: Variable declaration mistaken for function in ES
Thanks again for your input but as far as I know this is the standard syntax for STL container and iterator declarations:
Code:
std::vector<int> myIntVector;
std::vector<int>::iterator myIntVectorIterator;
which is what I'm using.
|
|
08-20-2013 08:27 AM |
|
Pixel Perfect
Member
|
RE: Variable declaration mistaken for function in ES
Sorry to have to bump this but I've not found another way of declaring these that avoids the problem.
Currently I'm having to comment out the declaration in the header file in Visual Studio each time I want to run my code which is not much fun.
|
|
08-21-2013 10:03 PM |
|
Esenthel
Administrator
|
RE: Variable declaration mistaken for function in ES
Hi, sorry for the issue, at the moment I can only tell that it will definitely work if you will use EE containers (Memc<int>)
I'll try to make it work in the nearest future.
|
|
08-21-2013 11:13 PM |
|