GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-May-2008, 09:10
lolp1 lolp1 is offline
New Member
 
Join Date: May 2008
Posts: 2
lolp1 is on a distinguished road

Error C2374


I don't have very much experience at all in C++.

I am using c++ Visual Studio 6.0.

I have this source code and when I try to compile it I get 42 errors and 20 warnings, could someone here fix them for me or help me fix them so that it will compile successfully?

Thanks a lot!

Here is the file, rapidshare.com

Here is the error log:
Code:
---------- --------------------Configuration: test - Win32 Debug-------------------- Compiling... Authorization.cpp c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(117) : error C2374: 'i' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(108) : see declaration of 'i' c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(159) : error C2374: 'i' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(150) : see declaration of 'i' c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(202) : error C2374: 'j' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(169) : see declaration of 'j' c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(220) : error C2374: 'j' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(169) : see declaration of 'j' c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(264) : error C2374: 'i' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\authorization.cp p(260) : see declaration of 'i' AutoAim.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\AutoAim.cpp(38) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\AutoAim.cpp(35) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\AutoAim.cpp(66) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\AutoAim.cpp(13) : see declaration of 'i' Blowfish.cpp Callstubs.cpp CommonMath.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\CommonMath.cpp(1 52) : error C2065: 'DOUBLE' : undeclared identifier C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\CommonMath.cpp(1 52) : error C2146: syntax error : missing ')' before identifier 'nAngle' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\CommonMath.cpp(1 52) : error C2059: syntax error : ')' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\CommonMath.cpp(1 53) : error C2146: syntax error : missing ')' before identifier 'nAngle' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\CommonMath.cpp(1 53) : error C2059: syntax error : ')' Control.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Control.cpp(6) : warning C4018: '==' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Control.cpp(6) : warning C4018: '==' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Control.cpp(6) : warning C4018: '==' : signed/unsigned mismatch D2Stdio.cpp D2Stubs.cpp DllMain.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\DllMain.cpp(63) : error C2065: 'GET_WHEEL_DELTA_WPARAM' : undeclared identifier C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\DllMain.cpp(149) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\DllMain.cpp(130) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\DllMain.cpp(155) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\DllMain.cpp(130) : see declaration of 'i' Drawing.cpp c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(11) : warning C4018: '!=' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(22) : error C2374: 'i' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(15) : see declaration of 'i' c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(57) : warning C4018: '==' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(80) : warning C4018: '==' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(196) : error C2374: 'i' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(177) : see declaration of 'i' c:\documents and settings\hans\desktop\ok\wtftppfk\drawing.cpp(311) : warning C4018: '==' : signed/unsigned mismatch Driver.cpp c:\documents and settings\hans\desktop\ok\wtftppfk\driver.cpp(45) : error C2065: 'OpenThread' : undeclared identifier c:\documents and settings\hans\desktop\ok\wtftppfk\driver.cpp(45) : error C2440: 'initializing' : cannot convert from 'int' to 'void *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast Enchant.cpp Handlers.cpp c:\documents and settings\hans\desktop\ok\wtftppfk\handlers.cpp(384 ) : warning C4018: '==' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\handlers.cpp(411 ) : warning C4018: '==' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\handlers.cpp(451 ) : warning C4018: '==' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\handlers.cpp(462 ) : warning C4018: '==' : signed/unsigned mismatch c:\documents and settings\hans\desktop\ok\wtftppfk\handlers.cpp(722 ) : error C2374: 'i' : redefinition; multiple initialization c:\documents and settings\hans\desktop\ok\wtftppfk\handlers.cpp(688 ) : see declaration of 'i' Helpers.cpp c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(145) : error C2065: 'DOUBLE' : undeclared identifier c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(145) : error C2146: syntax error : missing ')' before identifier 'f' c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(145) : error C2373: 'AddCommas' : redefinition; different type modifiers c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.h(12) : see declaration of 'AddCommas' c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(145) : error C2440: 'initializing' : cannot convert from 'int' to 'char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(145) : error C2059: syntax error : ')' c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(146) : error C2143: syntax error : missing ';' before '{' c:\documents and settings\hans\desktop\ok\wtftppfk\helpers.cpp(146) : error C2447: missing function header (old-style formal list?) Item.cpp Maphack.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(121) : warning C4018: '==' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(122) : warning C4018: '==' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(251) : warning C4018: '==' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(382) : warning C4018: '!=' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(435) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(417) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(457) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(417) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(479) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(417) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(501) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(417) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(524) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Maphack.cpp(417) : see declaration of 'i' Me.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(143) : error C2065: 'DOUBLE' : undeclared identifier C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(143) : error C2146: syntax error : missing ';' before identifier 'nLifePercent' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(143) : error C2065: 'nLifePercent' : undeclared identifier C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(144) : error C2146: syntax error : missing ';' before identifier 'nManaPercent' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(144) : error C2065: 'nManaPercent' : undeclared identifier C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(157) : warning C4018: '<=' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(162) : warning C4018: '<=' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(169) : warning C4018: '<=' : signed/unsigned mismatch C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Me.cpp(178) : warning C4018: '<=' : signed/unsigned mismatch Offset.cpp PathFinder.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\PathFinder.cpp(6 0) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\PathFinder.cpp(1 5) : see declaration of 'i' Settings.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Settings.cpp(175 ) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Settings.cpp(112 ) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Settings.cpp(177 ) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Settings.cpp(112 ) : see declaration of 'i' C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Settings.cpp(180 ) : error C2374: 'i' : redefinition; multiple initialization C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Settings.cpp(112 ) : see declaration of 'i' Skill.cpp Threads.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Threads.cpp(322) : error C2360: initialization of 'i' is skipped by 'case' label C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Threads.cpp(298) : see declaration of 'i' Unit.cpp C:\Documents and Settings\hans\Desktop\ok\WtfTPPfK\Unit.cpp(236) : warning C4018: '==' : signed/unsigned mismatch Error executing cl.exe. test.dll - 42 error(s), 20 warning(s) ----------
  #2  
Old 25-May-2008, 11:57
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: Need help compiling this


Quote:
Originally Posted by lolp1
I have this source code and when i try to compile it i get 42 errors and 20 warnings, could someone here fix them for me or help me fix them so that it will compile successfully ?
WIthout seeing the code, all anyone here can do is repeat what is already stated in the warnings & errors you already have in front of you. In particular, it looks like you are having repeated problems with redefining specific variable names within the same scope.
  • Perhaps what you need to do is break the problem down mentally into something more manageable. Take the first error & study the code which it indicates. Since you have repeated redefined variable name problems, look within the same scope & find where other variables are defined with the same name. Systematically resolve these problems one after the other.
  • Most compilers will correctly identify the first errors correctly. As compilers work their way through more errant code, they tend to begin flagging all kinds of things as errors when in fact they weren't. Because of this, resolve the first few errors followed by recompiling again. It is not uncommon to fix just a few errors & find out that all other errors vaporized. If I had to guess, I suspect that some of the assignment & Boolean operator errors seen in the output presented may go away once you have resolved some of these duplicate symbol problems.
In general, treat debugging as an exercise in divide & conquer. Break the overall situation into smaller more manageable pieces & attach them one after another.
  #3  
Old 25-May-2008, 12:19
lolp1 lolp1 is offline
New Member
 
Join Date: May 2008
Posts: 2
lolp1 is on a distinguished road

Re: Need help compiling this


Oh here is the source, it got filtered somehow

rapidshare.c0m/files/117510265/WtfTPPfK.zip.html

change the 0 to a o
  #4  
Old 25-May-2008, 17:40
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,218
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Need help compiling this


Quote:
Originally Posted by lolp1
Oh here is the source...


Speaking only for myself, I will flatly say that I have no intention of going to a questionable site and downloading a questionable zip file and trying to debug your program for you. Sorry. Maybe someone else is a little more adventuresome...

Now, if you are not familiar with C++ and you are using an old, buggy compiler like Visual C++ version 6, and you are having problems, I don't know whether anyone can really help.

However...

I know for a fact that programs like the following give the "multiple initialization" error with Visual C++ version 6. Try it on your system:

CPP / C++ / C Code:
#include <iostream>
using namespace std;

int main()
{
    for (int i = 0; i < 5; i++) {
        cout << "Loop1: i = " << i << endl;
    }
    cout << endl;
    for (int i = 4; i >= 0; i--) {
        cout << "Loop2: i = " << i << endl;
    }
    return 0;
}

This is Standard C++, and should give an output that looks like:
Code:
Loop1: i = 0 Loop1: i = 1 Loop1: i = 2 Loop1: i = 3 Loop1: i = 4 Loop2: i = 4 Loop2: i = 3 Loop2: i = 2 Loop2: i = 1 Loop2: i = 0

Later versions of Microsoft compilers have no problems with this code. Recent Borland compilers (I don't know and don't care about Turbo C versions 1, 2, or 3) have no problems with this. GNU compilers have no problems with this.

Bottom line: If you are a little familiar with C++, then it shouldn't be difficult to modify the source so that variables are all declared at the beginning of a block (beginning of a function for example, like we did in C programs before the '99 standard). If you aren't even that familiar with C++, then I think you might be better off learning on simple programs before tackling this project.

I, personally, would favor downloading a current compiler. Free ones are available from Microsoft, Borland, and GNU.

Anyhow, after you resolve the multiple definitions, there still may be some other problems. You won't know until you get past the ones that I told you about. Sometimes fixing one type of problem fixes other messages as well.

If you aren't even familiar enough with C++ to go through and collect variable declarations at the beginning of each function, I'm not sure that trying to compile OPC (Other People's Code) is the best and most efficient learning experience, but I wish you luck.


Regards,

Dave
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling a program with gcc dabigmooish C++ Forum 3 26-Sep-2007 11:15
basic question regarding compiling a program cornsnap C++ Forum 24 16-May-2007 15:08
getting an error while compiling and running using different IDE. jaro C Programming Language 0 25-Aug-2006 10:14
Compiling Help gh0st16 C++ Forum 1 22-Jan-2005 07:45
Compiling error when doing SQL database in C++ confused_pig C++ Forum 2 12-Jan-2005 22:08

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 14:24.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.