Page 1 of 1

Compiling issue involves LNK2019

Posted: Tue Oct 31, 2006 10:17 am
by crankyplayer
I had a question about compiling i am using the free VS2005 Express and have followed the instructions 1 -5 which pertain to changing files. i am now on the Compiling MQ2 and i get all the way to step 9 and when i try to complete step 9 i get what follows. I have read the troubleshooting section for the code LNK2019 and i am still not understanding what i should do to fix this problem... the message i get when i try to build EQ2Main is as follows :

http://www.macroquest2.com/wiki/index.p ... nal_symbol

------ Build started: Project: MQ2Main, Configuration: Release Win32 ------
Compiling...
MQ2Windows.cpp
MQ2Utilities.cpp
MQ2Spawns.cpp
MQ2Pulse.cpp
MQ2PluginHandler.cpp
MQ2ParseAPI.cpp
MQ2Mouse.cpp
MQ2Main.cpp
EQLIB_EXPORTS
MQ2MacroCommands.cpp
MQ2KeyBinds.cpp
MQ2Globals.cpp
MQ2DInput.cpp
MQ2DetourAPI.cpp
MQ2DataVars.cpp
MQ2DataTypes.cpp
MQ2DataAPI.cpp
MQ2Data.cpp
MQ2Commands.cpp
MQ2CommandAPI.cpp
MQ2CleanUI.cpp
Generating Code...
Compiling...
MQ2ChatHook.cpp
MQ2Benchmarks.cpp
MQ2Auth.cpp
EQClasses.cpp
Generating Code...
Linking...
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
"/OUT:..\Release/MQ2Main.dll" /INCREMENTAL:NO "/LIBPATH:..\Detours\lib" /DLL /MANIFEST "/MANIFESTFILE:.\Intermediate\MQ2Main.dll.intermediate.manifest" /DEBUG "/PDB:c:\Documents and Settings\Smith\Desktop\macro\Release\MQ2Main.pdb" /MAP /MAPINFO:EXPORTS /SUBSYSTEM:WINDOWS /OPT:NOREF /OPT:NOICF "/BASE:0x03000000" "/IMPLIB:..\Release/MQ2Main.lib" /MACHINE:X86 /OPT:NOICF wsock32.lib winmm.lib kernel32.lib
".\Intermediate\EQClasses.obj"
".\Intermediate\MQ2Auth.obj"
".\Intermediate\MQ2Benchmarks.obj"
".\Intermediate\MQ2ChatHook.obj"
".\Intermediate\MQ2CleanUI.obj"
".\Intermediate\MQ2CommandAPI.obj"
".\Intermediate\MQ2Commands.obj"
".\Intermediate\MQ2Data.obj"
".\Intermediate\MQ2DataAPI.obj"
".\Intermediate\MQ2DataTypes.obj"
".\Intermediate\MQ2DataVars.obj"
".\Intermediate\MQ2DetourAPI.obj"
".\Intermediate\MQ2DInput.obj"
".\Intermediate\MQ2Globals.obj"
".\Intermediate\MQ2KeyBinds.obj"
".\Intermediate\MQ2MacroCommands.obj"
".\Intermediate\MQ2Main.obj"
".\Intermediate\MQ2Mouse.obj"
".\Intermediate\MQ2ParseAPI.obj"
".\Intermediate\MQ2PluginHandler.obj"
".\Intermediate\MQ2Pulse.obj"
".\Intermediate\MQ2Spawns.obj"
".\Intermediate\MQ2Utilities.obj"
".\Intermediate\MQ2Windows.obj"
Creating library ..\Release/MQ2Main.lib and object ..\Release/MQ2Main.exp
MQ2Auth.obj : error LNK2019: unresolved external symbol __imp__CallNextHookEx@16 referenced in function "long __stdcall proc(int,unsigned int,long)" (?proc@@YGJHIJ@Z)
MQ2Main.obj : error LNK2001: unresolved external symbol __imp__CallNextHookEx@16
MQ2Commands.obj : error LNK2019: unresolved external symbol __imp__ShellExecuteA@24 referenced in function _Exec
MQ2DetourAPI.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl CrashDetected_Detour(unsigned long,unsigned long,unsigned long,unsigned long,unsigned long)" (?CrashDetected_Detour@@YAXKKKKK@Z)
MQ2Main.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
MQ2PluginHandler.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
MQ2Utilities.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
MQ2Main.obj : error LNK2019: unresolved external symbol __imp__SetWindowsHookExA@16 referenced in function "void __cdecl InjectEnable(void)" (?InjectEnable@@YAXXZ)
MQ2Main.obj : error LNK2019: unresolved external symbol __imp__UnhookWindowsHookEx@4 referenced in function "void __cdecl InjectDisable(void)" (?InjectDisable@@YAXXZ)
..\Release/MQ2Main.dll : fatal error LNK1120: 5 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Smith\Desktop\macro\MQ2Main\Intermediate\BuildLog.htm"
MQ2Main - 10 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If anyone could pls help me that would be great


If you installed using default directories, navigate to C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults and edit corewin_express.vsprops, changing the following:
Change AdditionalDependencies="kernel32.lib" to
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"

I did that already

Thanx for the thought guys

Posted: Tue Oct 31, 2006 10:58 am
by fearless
Click on the wiki link above.
In the search box, type lnk2019.
Click go.
Click "Help Compiling".
Click "# 3.10 error LNK2019: unresolved external symbol".
Read.
Read again.
And again.

Or if you prefer to use the phpbb search engine . . .

Click on the search link above.
In the keyword box, type lnk2019.
For Display Results As, click Posts.
Click Search.
Read.
Read again.
And again.

That will be $5 for the lessons on how to use search engines, next one is $10.

Compile

Posted: Wed Nov 01, 2006 1:40 pm
by crankyplayer
I searched the post you suggested and didnt find any clear cut solution to my question - if you would be so kind as to put a link of your solution in a post i would greatly appriciate - bare with my stupidity as it hurts me more then you =)

Posted: Wed Nov 01, 2006 1:52 pm
by SwiftyMUSE
Long and short of it... Platform SDK was not installed properly. Start over from scratch installing the software and then the compile will work successfully.

No, I can't help further since I actually own the software and don't use the free tools for compiling.

1 other quesion

Posted: Wed Nov 01, 2006 3:40 pm
by crankyplayer
I had 1 other question maybe someone could answer -
step #7" Select Release, and place a check in each dll you want compiled"

how do i know which DLL files i want to compile? is it all files in the box or certain files

thanx for the input

Posted: Wed Nov 01, 2006 8:13 pm
by ascii38
You want them all.

first compile

Posted: Thu Jan 18, 2007 5:57 pm
by Charmmer
after reading many post and rereading many other post lol i cant find on the search "windows.h" ive folowed many links and emailed a few people , followed the simple instructions on the

Compiling for Free with VS2005 Express

The following information has been provided by a few different people on the MQ2 boards and from the MS website.
[edit]
Installation and Setting up the Environment

1. Download the Setup program here (link may change never know with MS) and install it.
2. Download SDK files from here. Install It.
3. Open VS2005 Express:
1. From the Tools drop down menu, select Options...
2. Expand the "Projects and Solutions" tree and select "VC++ Directories"
3. In the right window from the "Show Directories for" drop down menu select the following items and add the paths below:
* Executable files: C:\Program Files\Microsoft Platform SDK\Bin
* Include files: C:\Program Files\Microsoft Platform SDK\include
* Library files: C:\Program Files\Microsoft Platform SDK\lib
4. Make sure the directories you just entered are at the top of the list. If not, use the Up or Down arrows to put them in the correct order.
5. Alternately, you can double click on the existing Microsoft Platform SDK references that VC Express installed and edit them to point to the path you installed your Microsoft Platform SDK to.
* Either way, you want only one reference to the MS Platform SDK for each item. You should remove any duplicate references to a Microsoft Platform SDK directory.
4. If you installed using default directories, navigate to C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults and edit corewin_express.vsprops, changing the following:
* Change AdditionalDependencies="kernel32.lib" to
* AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"
5. Navigate to C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\ and edit AppSettings.htm, commenting out lines 441-444 like this:

// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true;
// DLL_APP.disabled = true;
// DLL_APP_LABEL.disabled = true;

[edit]
Compiling MQ2

1. Download the MacroQuest2 source zip and unzip it
2. Right click the newly created folder, select Properties, and remove the Read only flag
3. Run MQ2Auth.exe.
4. Double-click the Macroquest2.sln file. VC.net will open the MacroQuest project
5. If asked to update the code for the current version of .net, click yes
6. Go to the Build menu and select Configuration Manager
7. Select Release, and place a check in each dll you want compiled
8. In the Solution Explorer, right-click on MQ2Main and choose "Set as Startup Project"
9. With MQ2Main selected in the Solution Explorer, go to Build - Build MQ2Main
10. Go to Build - Batch Build, click "Select All" and then "Build"
11. The dll files will compile and be placed in the Release folder

i get to #9 and recieve errors

------ Build started: Project: MQ2Main, Configuration: Release Win32 ------
Compiling...
MQ2Windows.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Utilities.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Spawns.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Pulse.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2PluginHandler.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2ParseAPI.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Mouse.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Main.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2MacroCommands.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2KeyBinds.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Globals.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2DInput.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2DetourAPI.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2DataVars.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2DataTypes.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2DataAPI.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Data.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Commands.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2CommandAPI.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2CleanUI.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Generating Code...
Compiling...
MQ2ChatHook.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Benchmarks.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MQ2Auth.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
EQClasses.cpp
d:\macro\mq2-20070117\mq2main\MQ2Main.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Generating Code...
Build log was saved at "file://d:\macro\MQ2-20070117\MQ2Main\Intermediate\BuildLog.htm"
MQ2Main - 24 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Posted: Thu Jan 18, 2007 6:07 pm
by Charmmer
and i redownloaded SDK as well and then deleted the vc++ and the SDK and redownloaded again lol

Posted: Thu Jan 18, 2007 6:16 pm
by Charmmer
lol i think i figured it out the path to the SDK was wrong on the instructions it needed to read

D:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
instead of

D:\Program Files\Microsoft Platform SDK

Embedding manifest...
Build log was saved at "file://d:\macro\MQ2-20070117\MQ2Chat\Intermediate\BuildLog.htm"
MQ2Chat - 0 error(s), 0 warning(s)
========== Build: 12 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

Posted: Fri Mar 16, 2007 12:57 pm
by think
I had the same problems- then I realized I had used the previous tab column for the // on

5. Navigate to C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\ and edit AppSettings.htm, commenting out lines 441-444 like this:

// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true;
// DLL_APP.disabled = true;
// DLL_APP_LABEL.disabled = true;

Removed the // in column 2 and inserted into the same tab column (3) as
WIN_APP.disabled = true;
WIN_APP_LABEL.disabled = true;
DLL_APP.disabled = true;
DLL_APP_LABEL.disabled = true;

and everything worked fine.

Posted: Fri Mar 16, 2007 4:07 pm
by an_noob_001
Skip step 9