Page 1 of 7

Compiler Problems

Posted: Fri Mar 07, 2003 6:22 pm
by Mckorr
Brain not working... keep getting these errors when trying to compile EQlib.dll:

Code: Select all

Compiling resources...
Compiling...
EQLib.cpp
events.cpp
C:\IRC-20030111\EQLib\mq.h(778) : error C2065: 'INTERFACE' : undeclared identifier
C:\IRC-20030111\EQLib\mq.h(778) : error C2065: 'This' : undeclared identifier
C:\IRC-20030111\EQLib\mq.h(778) : error C2275: 'PCHAR' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(161) : see declaration of 'PCHAR'
C:\IRC-20030111\EQLib\mq.h(778) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\mq.h(778) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\mq.h(778) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\mq.h(778) : error C2071: 'fEQWriteChatColor' : illegal storage class
C:\IRC-20030111\EQLib\mq.h(781) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\mq.h(781) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\mq.h(781) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\mq.h(781) : error C2071: 'fEQClick' : illegal storage class
C:\IRC-20030111\EQLib\mq.h(782) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\mq.h(782) : error C2275: 'LPVOID' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(158) : see declaration of 'LPVOID'
C:\IRC-20030111\EQLib\mq.h(782) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\mq.h(782) : error C2071: 'fGetDeviceState' : illegal storage class
PerlMod.cpp
C:\IRC-20030111\EQLib\MQ.h(778) : error C2065: 'INTERFACE' : undeclared identifier
C:\IRC-20030111\EQLib\MQ.h(778) : error C2065: 'This' : undeclared identifier
C:\IRC-20030111\EQLib\MQ.h(778) : error C2275: 'PCHAR' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(161) : see declaration of 'PCHAR'
C:\IRC-20030111\EQLib\MQ.h(778) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(778) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(778) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\MQ.h(778) : error C2071: 'fEQWriteChatColor' : illegal storage class
C:\IRC-20030111\EQLib\MQ.h(781) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(781) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(781) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\MQ.h(781) : error C2071: 'fEQClick' : illegal storage class
C:\IRC-20030111\EQLib\MQ.h(782) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(782) : error C2275: 'LPVOID' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(158) : see declaration of 'LPVOID'
C:\IRC-20030111\EQLib\MQ.h(782) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\MQ.h(782) : error C2071: 'fGetDeviceState' : illegal storage class
PerlModCore.cpp
C:\IRC-20030111\EQLib\MQ.h(778) : error C2065: 'INTERFACE' : undeclared identifier
C:\IRC-20030111\EQLib\MQ.h(778) : error C2065: 'This' : undeclared identifier
C:\IRC-20030111\EQLib\MQ.h(778) : error C2275: 'PCHAR' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winnt.h(161) : see declaration of 'PCHAR'
C:\IRC-20030111\EQLib\MQ.h(778) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(778) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(778) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\MQ.h(778) : error C2071: 'fEQWriteChatColor' : illegal storage class
C:\IRC-20030111\EQLib\MQ.h(781) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(781) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(781) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\MQ.h(781) : error C2071: 'fEQClick' : illegal storage class
C:\IRC-20030111\EQLib\MQ.h(782) : error C2275: 'DWORD' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(141) : see declaration of 'DWORD'
C:\IRC-20030111\EQLib\MQ.h(782) : error C2275: 'LPVOID' : illegal use of this type as an expression
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\windef.h(158) : see declaration of 'LPVOID'
C:\IRC-20030111\EQLib\MQ.h(782) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\IRC-20030111\EQLib\MQ.h(782) : error C2071: 'fGetDeviceState' : illegal storage class
stdafx.cpp
timers.cpp
Error executing cl.exe.
Creating browse info file...

EQLib.dll - 45 error(s), 0 warning(s)
Any help?

Posted: Fri Mar 07, 2003 6:25 pm
by Mckorr
More information. Problem seems to be in this section of mq.h:

Code: Select all

// ***************************************************************************
// Everquest function typedefs
// ***************************************************************************
typedef DWORD	(__stdcall *fEQWriteChatColor)(THIS_ PCHAR, DWORD, DWORD);
typedef PCHAR	(__stdcall *fEQGetStringByID)(DWORD);
typedef VOID	(__cdecl *fEQCommand)(PSPAWNINFO, PCHAR);
typedef VOID	(__stdcall *fEQClick)(THIS_ DWORD, DWORD);
typedef HRESULT	(__stdcall *fGetDeviceState)(THIS_ DWORD, LPVOID);
typedef DWORD	(__stdcall *fEQScreenItem)(DWORD, DWORD, DWORD);
typedef DWORD	(__stdcall *fEQScreenSpawn)(DWORD, DWORD);
typedef PCHAR   (__stdcall *fEQNewUIINI)(VOID);

Posted: Fri Mar 07, 2003 7:11 pm
by dont_know_at_all
You are picking up the wrong dinput.h for one thing.

Posted: Fri Mar 07, 2003 8:03 pm
by dont_know_at_all
For the VC60 compiler, you must:
1. Compile the detours source and move lib and pdb file into appropriate directory
2. Create a blank win32 application project pointing at the MQ directory.
3. Add a win32 dll project to the project in step 2. Call it eqlib
4. Add all the sources in the eqlib directory to the eqlib project.
5. Add the CINTERFACE definition to the Preprocess definitions.
6. Add the DX8.1 include path to the Additional include directories.
7. Add ws2_32.lib to the Object/library modules.
8. Add ..\Detours\lib (where you put the objects from 1.) to Additional library path
9. Press F7 and cross your fingers.
10. Switch back to the main project.
11. Add the sources in the MacroQuest directory to this project.
12. Press F7 and pray.

Everything should have compiled at that point. Gather up exe and eqlib.dll and you should be good to go.

Posted: Mon Mar 10, 2003 9:02 am
by Mckorr
Thanks, that worked. Problem was adding CINTERFACE to preprocess, and in recompiling Detours.

Posted: Mon Mar 10, 2003 10:41 am
by driftinsupra
sorry you got a coding newb here, howcomile the detours source?

Posted: Mon Mar 10, 2003 11:03 am
by Mckorr
Again, depends on what compiler you are using.

Extract Detours.exe to a temp directory. That will create an SRC directory within the temp directory.

Now, open up a command console, go to that directory. In my case C:\temp\src. If you are using VC++, from the command line type "nmake". That will read the Makefile in the SRC directory and create three files, detours.h, detours.lib, and detours.pdb. Copy detours.h to the include subdirectory of your compiler. Copy the other two to the lib directory.

These files will now be ready to use for compiling, and your compiler will find them without jumping through a bunch of hoops.

Now, when you extract Detours.exe you will find that these three files already exist. Problem is they won't work for compiling MQ. Delete the files that came with the distribution and recompile as above.

Posted: Mon Mar 10, 2003 12:12 pm
by papiraul
How do I extract detours.exe form detours.h in VC6?

Posted: Mon Mar 10, 2003 1:21 pm
by driftinsupra
I didnt see any detours.exe file, wheres it at?

Posted: Mon Mar 10, 2003 1:23 pm
by driftinsupra
of yea I am using vc++

Posted: Mon Mar 10, 2003 1:29 pm
by Mckorr
Ack!

Detours is distributed by Microsoft. You can get it here: http://research.microsoft.com/sn/detours/

Download detours.exe, that is a self-extracting WinZip file. Run it (double click on it) and pick a temp directory to extract it to, say C:\temp.

Now, go to C:\temp, and delete the files in the LIB and INCLUDE subdirectory. Call up a command console (a command line, y'know, C:>).

Change to the SRC directory (C:\temp\src). Execute a make command, that's "nmake" if you have VC++. This will compile the source code in the SRC directory, and place detours.h in the empty INCLUDE directory, and detours.lib and detours.pdb in the LIB directory. Copy those files to your compilers LIB and INCLUDE directories.

The detours part of the code will now compile correctly.

Posted: Mon Mar 10, 2003 1:41 pm
by driftinsupra
woot, thanks

Posted: Mon Mar 10, 2003 2:23 pm
by almostleet
I have eqlib.dll and the .exe compiled but MQ shuts down as soon as I run it. Any ideas on what I did wrong?

Posted: Mon Mar 10, 2003 2:45 pm
by Mckorr
Which version of the sourcecode are you using?

Do you have the latest offsets, and are they in the eqgame.ini file?

Sounds like a basic configuration problem.

Posted: Mon Mar 10, 2003 2:49 pm
by papiraul
Mkorr.. could you please explain a bit more in detail on how to add preprocess and Dx8.1 and so on?