Unresolved external symbol

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

thenewone2421
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed May 28, 2003 7:12 am

Unresolved external symbol

Post by thenewone2421 » Sun Feb 29, 2004 2:12 am

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)

thenewone2421
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed May 28, 2003 7:12 am

Post by thenewone2421 » Sun Feb 29, 2004 2:41 am

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)


Crun
orc pawn
orc pawn
Posts: 12
Joined: Wed Dec 03, 2003 12:16 am

Post by Crun » Sun Feb 29, 2004 2:44 am

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

ChrisCim
a lesser mummy
a lesser mummy
Posts: 77
Joined: Sun Feb 29, 2004 2:45 am

Post by ChrisCim » Sun Feb 29, 2004 2:46 am

Getting the same errors, been looking for an hour or so trying to find a post about this but cant find anything.

ChrisCim
a lesser mummy
a lesser mummy
Posts: 77
Joined: Sun Feb 29, 2004 2:45 am

Post by ChrisCim » Sun Feb 29, 2004 2:48 am

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)
Last edited by ChrisCim on Sun Feb 29, 2004 2:47 am, edited 1 time in total.

thenewone2421
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed May 28, 2003 7:12 am

Post by thenewone2421 » Sun Feb 29, 2004 2:49 am

so this error must be unique to 28 feb

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Sun Feb 29, 2004 2:49 am

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.
Last edited by Elric on Sun Feb 29, 2004 2:55 am, edited 1 time in total.
-Elric

thenewone2421
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed May 28, 2003 7:12 am

Post by thenewone2421 » Sun Feb 29, 2004 2:51 am

yeah it appears to be in the cvs, i'll try to compile it with mq2spawns.cpp brb

thenewone2421
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed May 28, 2003 7:12 am

Post by thenewone2421 » Sun Feb 29, 2004 3:00 am

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

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Sun Feb 29, 2004 3:04 am

Look at my edit above.
-Elric

thenewone2421
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed May 28, 2003 7:12 am

Post by thenewone2421 » Sun Feb 29, 2004 3:10 am

ok i know, but unfortunately my old source is really really old(mq1), I'll just have to wait for the update :lol:

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sun Feb 29, 2004 3:28 am

Add MQ2Spawns.cpp to your MQ2Main project, sorry for the confusion

/me looks around for the beating stick to give Amadeus a beating :)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Sun Feb 29, 2004 3:38 am

Mothereff.. I was on the right track, just poking my nose into the wrong hole.
-Elric

ChrisCim
a lesser mummy
a lesser mummy
Posts: 77
Joined: Sun Feb 29, 2004 2:45 am

Post by ChrisCim » Sun Feb 29, 2004 4:48 am

Viola, thanks for the help :D

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sun Feb 29, 2004 9:58 am

OK, not sure if this change was intentional. I always had commented out

Code: Select all

 #define DBG_SPEW
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 :)