Game Development Community

Include hell

by Neil Marshall · in Torque Game Engine · 04/25/2006 (7:31 am) · 3 replies

I've got a compiler problem with the TGE Browser plugin and I'm wondering if someone can help me out with it. The code thats currently on TDN is pretty much where I'm stuck right now.

tdn.garagegames.com/wiki/TGE/Code/How_to_make_torque_a_plugin
April 21st version

When you compile you need to comment out the ATL includes in plugin.cpp, get an error, uncomment the ATL lines, and then recompile for it to work. I'm trying to get rid of this hackery as it's most likely the cause of problems I'm having later on. Can someone who knows their compiler errors help me out with it? I keep running into problems with functions which should be linked to in windows.h.

C:\Projects\tge14\TGE14Plugin\engine\np3DPlugin\plugin.cpp(526): error C2065: 'WM_MOUSEWHEEL' : undeclared identifier
C:\Projects\tge14\TGE14Plugin\engine\np3DPlugin\plugin.cpp(485): error C3861: 'TrackMouseEvent': identifier not found, even with argument-dependent lookup

I'm at a loss as to what to try to fix the problem. windows.h includes fine in ax3DPlugin.h but not in the netscape plugin related files. Does anyone know how to get around this?

#1
04/25/2006 (8:14 am)
A Quick look around show's this:
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
#define WM_MOUSEWHEEL                   0x020A

find that in winuser.h

note that neither of those preprocessor directives are declared by default.

#if(_WIN32_WINNT >= 0x0400)
#ifndef NOTRACKMOUSEEVENT

.... *snipped*

WINUSERAPI
BOOL
WINAPI
TrackMouseEvent(
    LPTRACKMOUSEEVENT lpEventTrack);
...

suffers from the same problem.
probably as simple as defining _WIN32_WINNT to pass those qualifiers.
I'm not 100% sure of the cleanest way to do this if it is done with a different header.
you can just declare that directive and try that.
or continue the research.
#2
04/25/2006 (1:00 pm)
Argh, that worked. I had that line all along in my code but it was below the include. I moved it to the top and everything started working again.

Thanks
#3
04/25/2006 (1:54 pm)
Doh! I told you about _WIN32_WINNT days ago on IRC.... =)