Page 1 of 2

Compile errors: March 16 2004 18:38:07 Release

Posted: Tue Mar 16, 2004 10:35 pm
by mrjoshuanc
Now, normally I'm a good lurker, strong RTFM proponent, all around self sufficient user. But this one I'm not sure how to fix, I'm just not that good. I'll assume this release is current from the date, so if anyone has any suggestions (or how I was just simply stupid and missed something easy) by all means...and thanks :)

Using VS .NET at my office to compile, I receive the following output.

Compiling...
MQ2Utilities.cpp
MQ2Utilities.cpp(1212) : error C2668: 'abs' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(584): could be 'long double abs(long double)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(536): or 'float abs(float)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(530): or 'double abs(double)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(528): or 'long abs(long)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(265): or 'int abs(int)'
while trying to match the argument list '(DWORD)'
MQ2Utilities.cpp(1248) : error C2668: 'abs' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(584): could be 'long double abs(long double)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(536): or 'float abs(float)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(530): or 'double abs(double)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(528): or 'long abs(long)'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(265): or 'int abs(int)'
while trying to match the argument list '(DWORD)'
MQ2Commands.cpp
MQ2CommandAPI.cpp
MQ2CleanUI.cpp
MQ2ChatHook.cpp
MQ2Benchmarks.cpp
MQ2Auth.cpp
EQClasses.cpp

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2Main\Intermediate\BuildLog.htm"
MQ2Main - 2 error(s), 0 warning(s)


------ Build started: Project: MQ2Map, Configuration: Release Win32 ------

Compiling...
MQ2MapCommands.cpp
EQLIB_IMPORTS
MQ2MapAPI.cpp
MQ2Map.cpp
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2Map\Intermediate\BuildLog.htm"
MQ2Map - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2Telnet, Configuration: Release Win32 ------

Compiling...
WinTelnet.cpp
TelnetServer.cpp
EQLIB_IMPORTS
mq2telnet.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\mq2telnet\Intermediate\BuildLog.htm"
MQ2Telnet - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2Labels, Configuration: Release Win32 ------

Compiling...
MQ2Labels.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2Labels\Intermediate\BuildLog.htm"
MQ2Labels - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2ItemDisplay, Configuration: Release Win32 ------

Compiling...
MQ2ItemDisplay.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2ItemDisplay\Intermediate\BuildLog.htm"
MQ2ItemDisplay - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2Irc, Configuration: Release Win32 ------

Compiling...
MQ2Irc.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2Irc\Intermediate\BuildLog.htm"
MQ2Irc - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2FPS, Configuration: Release Win32 ------

Compiling...
MQ2FPS.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\Mq2fps\Intermediate\BuildLog.htm"
MQ2FPS - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2EQIM, Configuration: Release Win32 ------

Compiling...
MQ2EQIM.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\Mq2eqim\Intermediate\BuildLog.htm"
MQ2EQIM - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2EQBugFix, Configuration: Release Win32 ------

Compiling...
MQ2EQBugFix.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2EQBugFix\Intermediate\BuildLog.htm"
MQ2EQBugFix - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2CustomBinds, Configuration: Release Win32 ------

Compiling...
MQ2CustomBinds.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2CustomBinds\Intermediate\BuildLog.htm"
MQ2CustomBinds - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2ChatWnd, Configuration: Release Win32 ------

Compiling...
MQ2ChatWnd.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2ChatWnd\Intermediate\BuildLog.htm"
MQ2ChatWnd - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2Chat, Configuration: Release Win32 ------

Compiling...
MQ2Chat.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2Chat\Intermediate\BuildLog.htm"
MQ2Chat - 1 error(s), 0 warning(s)


------ Build started: Project: MQ2Bzsrch, Configuration: Release Win32 ------

Compiling...
MQ2Bzsrch.cpp
EQLIB_IMPORTS
Linking...
LINK : fatal error LNK1181: cannot open input file '..\Release\MQ2Main.lib'

Build log was saved at "file://c:\Documents and Settings\mrjoshua\Desktop\MacroQuest\MQ2Bzsrch\Intermediate\BuildLog.htm"
MQ2Bzsrch - 1 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 13 failed, 0 skipped

Posted: Tue Mar 16, 2004 10:47 pm
by carpaltunnel
I'm getting the same error, using VS .NET as well. I found 1 other post on the problem, but I'm not sure how to apply that to this code.

http://macroquest2.com/phpBB2/viewtopic.php?t=2763

Posted: Tue Mar 16, 2004 10:49 pm
by mrjoshuanc
Here are the offending lines mq2utilities.cpp (1212 & 1248)

switch(abs(EffectID))

sprintf(szTemp, "UndefinedEffect%03d", abs(EffectID));


From reading that, I'm not quite sure what I could change besides abs with int. Oh well, good time to learn something eh? :) Gonna try it and see what happens.

Posted: Tue Mar 16, 2004 11:01 pm
by mrjoshuanc
Ok, just replaced abs with int and got a successful compile, however it does break any scripts that use right clicks I guess, since apparently this is exactly the area of mq2utilities i just broke with my change =/

Guess I'll have to dig up a copy of VS6. Grrrr.

Posted: Tue Mar 16, 2004 11:25 pm
by carpaltunnel
Well after chatting with a friend, I removed abs from both lines. Compiled fine, running in game, right click item works fine for me in a macro.

Posted: Wed Mar 17, 2004 4:15 am
by devNull
What about casting the DWORD to int or long?

Code: Select all

switch(abs( (int) EffectID )) 

sprintf(szTemp, "UndefinedEffect%03d", abs( (int) EffectID ));
or

Code: Select all

switch( (int) abs( (long) EffectID )) 

sprintf(szTemp, "UndefinedEffect%03d", (int) abs( (long) EffectID ));

Posted: Wed Mar 17, 2004 4:45 am
by jumbotron
I got the same errors. Fatal errors and build failed using VS.NET.

Thanks for the great work you guys do. Very enjoyable product.

JT

Posted: Wed Mar 17, 2004 5:07 am
by jumbotron
Changing the code in MQ2Utilities.cpp on lines 1212 and 1248 (if I recall) to the following code allowed VC.NET to compile without errors.


switch(abs( (int) EffectID ))

sprintf(szTemp, "UndefinedEffect%03d", abs( (int) EffectID ));


Thank you DevNull,

JT

Posted: Wed Mar 17, 2004 5:31 am
by CrankyBaby
Casting them to (long) works as well, and might keep more info intact.

It's just a style thing from that point, though.

Posted: Wed Mar 17, 2004 7:07 am
by koad
this is from the update that was merged from my plugin's update that i posted the other day to mq2spellsearch, that code was redone and i neglected to include the typecasting for compatibility in .net

Posted: Wed Mar 17, 2004 9:57 am
by vzmule
You'll only have this problem if you're using 2003 version of .net. Compiles fine under .net standard (2002).

To fix it, see
http://macroquest2.com/phpBB2/viewtopic ... ght=#18434

compile error

Posted: Wed Mar 17, 2004 11:38 am
by huckleberry
I am getting
undeclared identifier for

_ActualVersionDate
_ActualVersionTime
_ExpectedVersionDate
_expectedVersionTime

any suggestions (besides use search as it brings up nothing)

using .net 2003

Thanks in advance

----------------------------
nm - must have been a conflict with the new download from today and the offests (from thread yeterday) - recompiled with DL'ed offsets .. no errors

Posted: Wed Mar 17, 2004 12:11 pm
by Sensay
nm found it

Posted: Wed Mar 17, 2004 12:13 pm
by morgar
Hrmm I must be missing something, because when I go to download MQ2, the only thing in the zipfile is a readme.txt. Where did you guys get this version from? (I tried downloading from the downloads section)..

Posted: Wed Mar 17, 2004 12:59 pm
by Lax
Hrmm I must be missing something, because when I go to download MQ2, the only thing in the zipfile is a readme.txt. Where did you guys get this version from? (I tried downloading from the downloads section)..
Whatever you're smoking, pass it this way.. and secondly why did you hijack a random thread to post that you're an idiot, having nothing at all to do with the topic?

Anyway anyone that gets this problem, replace abs(EffectID) with simply EffectID. abs as you know gets the absolute value of an integer, which does this: If (val<0) val=-val; However, EffectID is a DWORD, and a DWORD is an "unsigned long". Unsigned means that there is no possibility of negativity (will always be non-negative). Therefore, abs does nothing. Remove the abs.