Page 1 of 1
Unresolved external symbol
Posted: Sun Feb 29, 2004 2:12 am
by thenewone2421
When i try to build mq2main.dll
i get this error
Code: Select all
Linking...
Creating library ../Release/MQ2Main.lib and object ../Release/MQ2Main.exp
MQ2Main.obj : error LNK2001: unresolved external symbol _ShutdownMQ2Spawns
MQ2Main.obj : error LNK2001: unresolved external symbol _InitializeMQ2Spawns
../Release/MQ2Main.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
MQ2Main.dll - 3 error(s), 0 warning(s)
Posted: Sun Feb 29, 2004 2:41 am
by thenewone2421
heres the full build log
Code: Select all
Build Log
--------------------Configuration: MQ2Main - Win32 Release--------------------
Command Lines
Creating temporary file "C:\WINDOWS\TEMP\RSPE1D3.TMP" with contents
[
/nologo /Zp1 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CINTERFACE" /D "EQLIB_EXPORTS" /Fp"Intermediate/MQ2Main.pch" /YX /Fo"Intermediate/" /Fd"Intermediate/" /FD /c
"D:\mq2\MQ2Main\EQClasses.cpp"
"D:\mq2\MQ2Main\MQ2Auth.cpp"
"D:\mq2\MQ2Main\MQ2Benchmarks.cpp"
"D:\mq2\MQ2Main\MQ2ChatHook.cpp"
"D:\mq2\MQ2Main\MQ2CleanUI.cpp"
"D:\mq2\MQ2Main\MQ2CommandAPI.cpp"
"D:\mq2\MQ2Main\MQ2Commands.cpp"
"D:\mq2\MQ2Main\MQ2DetourAPI.cpp"
"D:\mq2\MQ2Main\MQ2DInput.cpp"
"D:\mq2\MQ2Main\MQ2Globals.cpp"
"D:\mq2\MQ2Main\MQ2MacroCommands.cpp"
"D:\mq2\MQ2Main\MQ2Main.cpp"
"D:\mq2\MQ2Main\MQ2Mouse.cpp"
"D:\mq2\MQ2Main\MQ2Parms.cpp"
"D:\mq2\MQ2Main\MQ2ParseAPI.cpp"
"D:\mq2\MQ2Main\MQ2PluginHandler.cpp"
"D:\mq2\MQ2Main\MQ2Pulse.cpp"
"D:\mq2\MQ2Main\MQ2UserVars.cpp"
"D:\mq2\MQ2Main\MQ2Utilities.cpp"
"D:\mq2\MQ2Main\MQ2Windows.cpp"
]
Creating command line "cl.exe @C:\WINDOWS\TEMP\RSPE1D3.TMP"
Creating temporary file "C:\WINDOWS\TEMP\RSPE1D4.TMP" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\Detours\lib60\detours.lib /nologo /dll /incremental:no /pdb:"../Release/MQ2Main.pdb" /machine:I386 /out:"../Release/MQ2Main.dll" /implib:"../Release/MQ2Main.lib" /OPT:NOICF /OPT:NOREF
.\Intermediate\EQClasses.obj
.\Intermediate\MQ2Auth.obj
.\Intermediate\MQ2Benchmarks.obj
.\Intermediate\MQ2ChatHook.obj
.\Intermediate\MQ2CleanUI.obj
.\Intermediate\MQ2CommandAPI.obj
.\Intermediate\MQ2Commands.obj
.\Intermediate\MQ2DetourAPI.obj
.\Intermediate\MQ2DInput.obj
.\Intermediate\MQ2Globals.obj
.\Intermediate\MQ2MacroCommands.obj
.\Intermediate\MQ2Main.obj
.\Intermediate\MQ2Mouse.obj
.\Intermediate\MQ2Parms.obj
.\Intermediate\MQ2ParseAPI.obj
.\Intermediate\MQ2PluginHandler.obj
.\Intermediate\MQ2Pulse.obj
.\Intermediate\MQ2UserVars.obj
.\Intermediate\MQ2Utilities.obj
.\Intermediate\MQ2Windows.obj
]
Creating command line "link.exe @C:\WINDOWS\TEMP\RSPE1D4.TMP"
Output Window
Compiling...
EQClasses.cpp
MQ2Auth.cpp
MQ2Benchmarks.cpp
MQ2ChatHook.cpp
MQ2CleanUI.cpp
MQ2CommandAPI.cpp
MQ2Commands.cpp
MQ2DetourAPI.cpp
MQ2DInput.cpp
MQ2Globals.cpp
MQ2MacroCommands.cpp
MQ2Main.cpp
EQLIB_EXPORTS
MQ2Mouse.cpp
MQ2Parms.cpp
MQ2ParseAPI.cpp
MQ2PluginHandler.cpp
MQ2Pulse.cpp
MQ2UserVars.cpp
MQ2Utilities.cpp
MQ2Windows.cpp
Linking...
Creating library ../Release/MQ2Main.lib and object ../Release/MQ2Main.exp
MQ2Main.obj : error LNK2001: unresolved external symbol _ShutdownMQ2Spawns
MQ2Main.obj : error LNK2001: unresolved external symbol _InitializeMQ2Spawns
../Release/MQ2Main.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Results
MQ2Main.dll - 3 error(s), 0 warning(s)
Posted: Sun Feb 29, 2004 2:44 am
by Crun
I tried to install MQ2 on a second pc tonight, and got the same errors. After searching the boards for quite a bit and finding nothing I deleted my folders and unzipped a copy I had downloaded 02/25/04..... compiled with no errors the first time.
Crun
Posted: Sun Feb 29, 2004 2:46 am
by ChrisCim
Getting the same errors, been looking for an hour or so trying to find a post about this but cant find anything.
Posted: Sun Feb 29, 2004 2:48 am
by ChrisCim
Build text
|
|
|
Code: Select all
-------------------Configuration: MQ2Main - Win32 Release--------------------
Compiling...
MQ2Auth.cpp
MQ2Benchmarks.cpp
MQ2ChatHook.cpp
MQ2CleanUI.cpp
MQ2CommandAPI.cpp
MQ2Commands.cpp
MQ2DetourAPI.cpp
MQ2DInput.cpp
MQ2Globals.cpp
MQ2MacroCommands.cpp
MQ2Main.cpp
EQLIB_EXPORTS
MQ2Mouse.cpp
MQ2Parms.cpp
MQ2ParseAPI.cpp
MQ2PluginHandler.cpp
MQ2Pulse.cpp
MQ2UserVars.cpp
MQ2Utilities.cpp
MQ2Windows.cpp
Linking...
Creating library ../Release/MQ2Main.lib and object ../Release/MQ2Main.exp
MQ2Main.obj : error LNK2001: unresolved external symbol _ShutdownMQ2Spawns
MQ2Main.obj : error LNK2001: unresolved external symbol _InitializeMQ2Spawns
../Release/MQ2Main.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
MQ2Main.dll - 3 error(s), 0 warning(s)
Posted: Sun Feb 29, 2004 2:49 am
by thenewone2421
so this error must be unique to 28 feb
Posted: Sun Feb 29, 2004 2:49 am
by Elric
Folks.. guys.. calm down.
"It's not working! OMG FUK U LAX U TRIKT US!" ...
Anyhow.
Code: Select all
Linking...
Creating library ../Release/MQ2Main.lib and object ../Release/MQ2Main.exp
MQ2Main.obj : error LNK2001: unresolved external symbol _ShutdownMQ2Spawns
MQ2Main.obj : error LNK2001: unresolved external symbol _InitializeMQ2Spawns
../Release/MQ2Main.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
That's just because we're missing a file, I believe. There are functions being called that don't exist except in mq2spawns.cpp, which I couldn't find in the zip. It's not a big hairy deal, just delete the folder, get the backup you made of your old folder(you DO make backups, right?!) and wait for the zip to be fixed.. OR, try to snag mq2spawns.cpp from the CVS(haven't checked it yet.)
Edit: And apparently I was very wrong. The file DOES exist, I found it after I redid my search. Hmm... We'll see what comes of it, but for now, just use the older source.
Posted: Sun Feb 29, 2004 2:51 am
by thenewone2421
yeah it appears to be in the cvs, i'll try to compile it with mq2spawns.cpp brb
Posted: Sun Feb 29, 2004 3:00 am
by thenewone2421
hmmmmmmm doesnt seem to work yet this is the source
Code: Select all
/*****************************************************************************
MQ2Main.dll: MacroQuest2's extension DLL for EverQuest
Copyright (C) 2002-2003 Plazmic, 2003-2004 Lax
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
******************************************************************************/
#if !defined(CINTERFACE)
#error /DCINTERFACE
#endif
#define DBG_SPEW
//#define DEBUG_TRY 1
#include "MQ2Main.h"
//EQLIB_API VOID PluginsAddSpawn(PSPAWNINFO pNewSpawn);
//EQLIB_API VOID PluginsRemoveSpawn(PSPAWNINFO pSpawn);
class EQPlayerHook
{
public:
void EQPlayer_ExtraDetour(PSPAWNINFO pSpawn)
{// note: we need to keep the original registers.
__asm {push eax};
__asm {push ebx};
__asm {push ecx};
__asm {push edx};
__asm {push esi};
__asm {push edi};
PluginsAddSpawn((PSPAWNINFO)pSpawn);
__asm {pop edi};
__asm {pop esi};
__asm {pop edx};
__asm {pop ecx};
__asm {pop ebx};
__asm {pop eax};
}
void EQPlayer_Trampoline(class EQPlayer *,unsigned char,unsigned int,unsigned char,char *);
void EQPlayer_Detour(class EQPlayer *a,unsigned char b,unsigned int c,unsigned char d,char * e)
{
PSPAWNINFO pSpawn;
__asm {mov [pSpawn], ecx};
EQPlayer_Trampoline(a,b,c,d,e);
EQPlayer_ExtraDetour(pSpawn);
}
void dEQPlayer_Trampoline(void);
void dEQPlayer_Detour(void)
{
PluginsRemoveSpawn((PSPAWNINFO)this);
dEQPlayer_Trampoline();
}
};
DETOUR_TRAMPOLINE_EMPTY(VOID EQPlayerHook::dEQPlayer_Trampoline(VOID));
DETOUR_TRAMPOLINE_EMPTY(VOID EQPlayerHook::EQPlayer_Trampoline(class EQPlayer *,unsigned char,unsigned int,unsigned char,char *));
VOID InitializeMQ2Spawns()
{
DebugSpew("Initializing Spawn-related Hooks");
EasyClassDetour(EQPlayer__EQPlayer,EQPlayerHook,EQPlayer_Detour,VOID,(class EQPlayer *,unsigned char,unsigned int,unsigned char,char *),EQPlayer_Trampoline);
EasyClassDetour(EQPlayer__dEQPlayer,EQPlayerHook,dEQPlayer_Detour,VOID,(VOID),dEQPlayer_Trampoline);
}
VOID ShutdownMQ2Spawns()
{
DebugSpew("Shutting Down Spawn-related Hooks");
RemoveDetour(EQPlayer__EQPlayer);
RemoveDetour(EQPlayer__dEQPlayer);
}
im sure its the right file, i put it in the mq2main folder and rebuild, still doesnt work
Posted: Sun Feb 29, 2004 3:04 am
by Elric
Look at my edit above.
Posted: Sun Feb 29, 2004 3:10 am
by thenewone2421
ok i know, but unfortunately my old source is really really old(mq1), I'll just have to wait for the update

Posted: Sun Feb 29, 2004 3:28 am
by Lax
Add MQ2Spawns.cpp to your MQ2Main project, sorry for the confusion
/me looks around for the beating stick to give Amadeus a beating :)
Posted: Sun Feb 29, 2004 3:38 am
by Elric
Mothereff.. I was on the right track, just poking my nose into the wrong hole.
Posted: Sun Feb 29, 2004 4:48 am
by ChrisCim
Viola, thanks for the help

Posted: Sun Feb 29, 2004 9:58 am
by wassup
OK, not sure if this change was intentional. I always had commented out
in mq2utilities.cpp and had no problems.
Now, if I do the same with the latest zip, I get the following errors:
Code: Select all
..\MQ2Main\MQ2Utilities.cpp(73): error C2065: 'szOutput' : undeclared identifier
..\MQ2Main\MQ2Utilities.cpp(73): error C2070: ''unknown-type'': illegal sizeof operand
..\MQ2Main\MQ2Utilities.cpp(73): error C2501: 'memset' : missing storage-class or type specifiers
..\MQ2Main\MQ2Utilities.cpp(73): error C2365: 'memset' : redefinition; previous definition was a 'function'
..\MQ2Main\MQ2Utilities.cpp(73): error C2078: too many initializers
..\MQ2Main\MQ2Utilities.cpp(74): error C2059: syntax error : '}'
..\MQ2Main\MQ2Utilities.cpp(74): error C2143: syntax error : missing ';' before '}'
..\MQ2Main\MQ2Utilities.cpp(74): error C2059: syntax error : '}'
..\MQ2Main\MQ2Utilities.cpp(76): error C2143: syntax error : missing ';' before '{'
..\MQ2Main\MQ2Utilities.cpp(76): error C2447: '{' : missing function header (old-style formal list?)
I looked and compared the code in the previous zip I had and this one and see some minor changes to VOID DebugSpewAlways(PCHAR szFormat, ...) but there is now a line of code that was not in the previous code, and seems to be causing the errors if I comment out #define DBG_SPEW:
Code: Select all
memset(szOutput, 0, sizeof(szOutput));
Everything compiles with no problems if I do not comment out #define DBG_SPEW so will just do that for now until I am either lambasted or someone figures out what is going on :)