Page 1 of 1

compiling oct 9 2008 zip - problem/fix with a declaration

Posted: Fri Oct 10, 2008 10:57 am
by ralliiart
I don't know if anybody else encountered this, but while compiling the zip from Oct 9 2008 (MQ2-20081009d) I was repeatedly getting an error about an i declaration in MQ2DataTypes.cpp on line 6996.

It's a for loop that declares i as a DWORD when initializing and it didn't like that. I changed the variable used in the loop to "iii" instead of "i", and declared it ahead of the loop instead of inside it, just to make sure, and and it compiled fine from there.

I think "i" was already declared or something before that loop, so it's not liking the re-declaration. Just a guess.

Re: compiling oct 9 2008 zip - problem/fix with a declaratio

Posted: Fri Oct 10, 2008 11:27 am
by vladd
ralliiart wrote:I don't know if anybody else encountered this, but while compiling the zip from Oct 9 2008 (MQ2-20081009d) I was repeatedly getting an error about an i declaration in MQ2DataTypes.cpp on line 6996.

It's a for loop that declares i as a DWORD when initializing and it didn't like that. I changed the variable used in the loop to "iii" instead of "i", and declared it ahead of the loop instead of inside it, just to make sure, and and it compiled fine from there.

I think "i" was already declared or something before that loop, so it's not liking the re-declaration. Just a guess.
do the following

Code: Select all

 case BuffCount:
      if(!(((PCTARGETWND)pTargetWnd)->BuffInfo > 0))
         return false;
      Dest.DWord = 0;
    [color=black]{[/color]
       for(DWORD i = 0; i < 0x55; i++)
         if(((PCTARGETWND)pTargetWnd)->BuffSpellID[i] != 0xffffffff)
            Dest.DWord++;
      Dest.Type = pIntType;
      return true;
     [color=black]}[/color]
its just a bracket issue, was in last months patch also till they added it in.

Posted: Fri Oct 10, 2008 11:45 am
by cheater
Getting the following wbefore I change anything

Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /Zp1 /MT /w /W0 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CINTERFACE" /D "EQLIB_EXPORTS" /Fo"Intermediate/" /Fd"Intermediate/" /FD /c
"C:\makaroni\MQ2Main\MQ2DataTypes.cpp"
MQ2DataTypes.cpp
C:\\makaroni\MQ2Main\MQ2DataTypes.cpp(7001) : error C2360: initialization of 'i' is skipped by 'case' label
C:\\makaroni\MQ2Main\MQ2DataTypes.cpp(6996) : see declaration of 'i'
Error executing cl.exe.

MQ2Main.dll - 1 error(s), 0 warning(s)


After I do the suggested change with the bracket, I get :

Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /Zp1 /MT /w /W0 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CINTERFACE" /D "EQLIB_EXPORTS" /Fo"Intermediate/" /Fd"Intermediate/" /FD /c
"C:\makaroni\MQ2Main\MQ2DataTypes.cpp"
MQ2DataTypes.cpp
C:\makaroni\MQ2Main\MQ2DataTypes.cpp(7002) : error C2360: initialization of 'i' is skipped by 'case' label
C:\makaroni\MQ2Main\MQ2DataTypes.cpp(6997) : see declaration of 'i'
C:\makaroni\MQ2Main\MQ2DataTypes.cpp(7009) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

MQ2Main.dll - 2 error(s), 0 warning(s)

Posted: Fri Oct 10, 2008 12:04 pm
by vladd
cheater wrote:Getting the following wbefore I change anything

Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /Zp1 /MT /w /W0 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CINTERFACE" /D "EQLIB_EXPORTS" /Fo"Intermediate/" /Fd"Intermediate/" /FD /c
"C:\makaroni\MQ2Main\MQ2DataTypes.cpp"
MQ2DataTypes.cpp
C:\\makaroni\MQ2Main\MQ2DataTypes.cpp(7001) : error C2360: initialization of 'i' is skipped by 'case' label
C:\\makaroni\MQ2Main\MQ2DataTypes.cpp(6996) : see declaration of 'i'
Error executing cl.exe.

MQ2Main.dll - 1 error(s), 0 warning(s)


After I do the suggested change with the bracket, I get :

Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /Zp1 /MT /w /W0 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CINTERFACE" /D "EQLIB_EXPORTS" /Fo"Intermediate/" /Fd"Intermediate/" /FD /c
"C:\makaroni\MQ2Main\MQ2DataTypes.cpp"
MQ2DataTypes.cpp
C:\makaroni\MQ2Main\MQ2DataTypes.cpp(7002) : error C2360: initialization of 'i' is skipped by 'case' label
C:\makaroni\MQ2Main\MQ2DataTypes.cpp(6997) : see declaration of 'i'
C:\makaroni\MQ2Main\MQ2DataTypes.cpp(7009) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

MQ2Main.dll - 2 error(s), 0 warning(s)
are you sure you placed it in the correct spot? because mine and several others have worked fine. Now mind you this is just an issue that Visual C++ has.

Posted: Fri Oct 10, 2008 1:34 pm
by dont_know_at_all
Fixed in latest zip.