PDA

View Full Version : Compile errors in VC++ 6.0


tcsmyworld
07-17-2003, 03:38 AM
Previous versions have compiled with no problems, but this new release returns a handful of errors and I can't figure out what I'm missing.
Here's a listing of the errors, any help would be appreciated.

errors in zone-

C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\attack.cpp(142) : error C2065: 'DEBUG' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\client.cpp(7316) : error C2065: 'DEBUG' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\client_process.cpp(328) : error C2065: 'DEBUG' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\client_process.cpp(5910) : error C2371: 'i' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\client_process.cpp(5900) : see declaration of 'i'
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\MobAI.cpp(307) : error C2065: 'DEBUG' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\parser.cpp(57) : error C2039: 'clear' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\parser.cpp(94) : error C2228: left of '.base' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\spells.cpp(488) : error C2065: 'DEBUG' : undeclared identifier


29 errors for 'clear' lines-57,71,114,152,169,172,255,542,925,937,986,1037,107 0,1264,1274,1275,1276,1277,1365,1366,1375,1376,
1386,1392,1393,1394,1400,1443,1459 all in parser.cpp

4 errors for '.base' lines- 94,98,102,106 all in parser.cpp


error in EMuShareMem-


C:\Program Files\Microsoft Visual Studio\EqEmu050\EMuShareMem\NPCFactionLists.cpp(55 ) : error C2065: 'DEBUG' : undeclared identifier

Merth
07-17-2003, 04:50 AM
For the DEBUG errors, go to Project/Settings and add DEBUG to the preprocessor defines.

For the other errors, just comment out the lines that are giving problems. Not sure at this point why vs6 complains about them.

tcsmyworld
07-17-2003, 04:56 AM
thanks Merth :)

alkrun
07-17-2003, 05:10 AM
C:\Program Files\Microsoft Visual Studio\EqEmu050\Zone\client_process.cpp(5910) : error C2371: 'i' : redefinition; different basic types

That one is because VC6 has a bit of broken ansi compatibility about declaring a variable in a for declaration. An example:


for(int i=0; i < 10; i++)
{
}

for(int i=0; i < 20; i++)
{
}


That won't compile. It's ANSI compliant to do that, but VC6 doesn't allow it because of a scope bug. The best way to rewrite that would be either to use a different name for your indexer or declare i outside of the for declarations.

either:

for(int i=0; i < 10; i++)
{
}

for(int j=0; j < 20; j++)
{
}


or:

int i;
for(i = 0; i < 10; i++)
{
}
for(i = 0; i < 20; i++)
{
}

tcsmyworld
07-17-2003, 09:55 AM
Is the .clear command from .net?
I replaced all the .clear with .empty and all compiled without errors.

alkrun
07-17-2003, 10:11 AM
clear() removes all elements, empty() tests if the string is empty or not. So replacing one with the other will have nasty side-effects.

clear() is not something new in STL. I don't know why it's giving an error. I haven't used VC6 in a while, but I do remember that it is pretty bad about the STL templates.

tcsmyworld
07-17-2003, 10:14 AM
Is there an equivelant of clear that might work in VC6?

BTW your calc fix took care of the .base errors I was having , thx.

alkrun
07-17-2003, 10:25 AM
Since you're just working with strings you could remove the call to clear and just set the string to "".

That might not function the exact same as clear() but it's close enough.

tcsmyworld
07-17-2003, 11:04 AM
Thx , that fixed a few ingame problems :)
Here the wierdest part yet, I found 6 instances of .clear in the parser.cpp(same file all the other errors were in) that don't return errors.

used_pawn
07-18-2003, 02:18 AM
I used .erase() instead of .clear(), seems to work.