Log in

View Full Version : Errors while compiling


Charmy
05-08-2004, 08:59 PM
I am using VS C++ 6.0 to compile this, and i am getting the following errors while trying to compile zone.exe


C:\Documents and Settings\Default\Desktop\EQEMu-05-08-2004\Zone\client_process.cpp(5021) : error C2086: 'i' : redefinition

C:\Documents and Settings\Default\Desktop\EQEMu-05-08-2004\Zone\npc.cpp(429) : error C2065: 'cit_timer' : undeclared identifier

C:\Documents and Settings\Default\Desktop\EQEMu-05-08-2004\Zone\npc.cpp(429) : error C2227: left of '->Check' must point to class/struct/union


Any ideas on what this is all about? i never get these errors when i compile using the VS.net Free version but i am sick of having to create a new accout every 3 hours of working, and i know i have read posts that people have used visual c++ to compile this.. so any help would be much appriciated thanks much =)

Derision
05-09-2004, 02:45 AM
C:\Documents and Settings\Default\Desktop\EQEMu-05-08-2004\Zone\client_process.cpp(5021) : error C2086: 'i' : redefinition

To fix this, edit client_process.cpp. Around line 5021, change the 'i' to a 'j' in the for loop:

for(int j = 0; j < 9; j++)
{
sze->equip[j] = GetEquipmentMaterial(j);
sze->colors[j].color = GetEquipmentColor(j);
}




C:\Documents and Settings\Default\Desktop\EQEMu-05-08-2004\Zone\npc.cpp(429) : error C2065: 'cit_timer' : undeclared identifier

This error seems to be caused because that bit of code should only be compiled for GUILDWARS and was introduced with the 05-08 source. Edit npc.cpp, goto line 429 and #ifdef that code, i.e.


#ifdef GUILDWARS
if(cit_timer && cit_timer->Check())
{
Depop();
return false;
}
#endif




C:\Documents and Settings\Default\Desktop\EQEMu-05-08-2004\Zone\npc.cpp(429) : error C2227: left of '->Check' must point to class/struct/union

That error will probably go away when you fix the previous one.

Charmy
05-09-2004, 09:49 AM
Thanks going to try it now =)

Charmy
05-09-2004, 09:57 AM
Woot thanks works without a flaw, although it worked i still don't understand why the first error occured was it just that i was defined incorrectly? or i am just not really sure. but anyway it works now! thanks much.

Derision
05-09-2004, 09:59 AM
Woot thanks works without a flaw, although it worked i still don't understand why the first error occured was it just that i was defined incorrectly? or i am just not really sure. but anyway it works now! thanks much.

Search for C2086, that issue has come up before with Viusal C++ 6.0, e.g.

http://www.eqemulator.net/forums/viewtopic.php?t=14521&highlight=c2086

Just changes to the language specs etc ...

Sith_Lord
05-09-2004, 08:28 PM
although it worked i still don't understand why the first error occured was it just that i was defined incorrectly?

'i' is quite a common variable name for counters and the like, but once a name has been defined within a scope it cant be redefined. So for example you cant have it as a string then immediately redefine it as an int. This also included defining it as the same thing again. Somewhere in that code block, i had been set up as a variable, then in this new release someone had dropped in a chunk that used a 'new' i. So changing every instance of one of the 'i's to another name fixes that issue.

Luke

Charmy
05-10-2004, 07:38 AM
So could you have in theroy changed it to any other unused variable? and it would have worked, or was J defined up earlier somewhere in the code that needed to be used? btw thanks for all the help. learning more everyday =)

Sith_Lord
05-10-2004, 08:05 AM
yeah, you defined it in the for loop when you said "int j;" basically that creates a variable called j inside that for loop. variable defiitions inherit downwards but not up - i.e. you coudlnt reference that j outside of the for loop, but somewhere above, i had already been defined, so that definition was inherited into the for loop, so you couldnt redefine it anywhere down-the-tree from where it was defined.

basically what the line you changed said was, this is a for loop . The condition at the start is that j is an int and equals 0; we run the for loop while ever j is less than 9 and at the end of each run through the loop j needs to be incremented. Then everything between the {}s is what needs doing each run thru. So yeah you could have used anything that wasnt already defined as long as everywhere in the loop you changed the j to be whatever.

sorry, a bit off topic :?

Luke