News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

undefined reference once again

Started by footprint, May 25, 2006, 05:20:14 PM

Previous topic - Next topic

footprint

Hi,

I've searched the forum for similar problem, but I didn't find answer. How it looks: I am trying to compile a simple dll project, where on DLL_PROCESS_ATTACH event is set such a code:

hhookKeyb = SetWindowHookEx(WH_KEYBOARD, KeyboardProc, hinstDLL, 0);

And my dll doesn't compile, because of... here is build log:

Linking dynamic library: testowe_dll.dll
Creating library file: libtestowe_dll.a
.objs\main.o:main.c:(.text+0x15b): undefined reference to `SetWindowHookEx'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

What's wrong with that?


thomas

First, I wonder you even manage to compile this program in the first place, since it is SetWindowsHookEx, not SetWindowHookEx.

Second, it is not SetWindowsHookEx but either SetWindowsHookExA or SetWindowsHookExW, depending on whether or not you use Unicode. This is normally handled by a macro (SetWindowsHookEx resolves to either the ANSI or Unicode version). If that is not the case, then your Windows headers must be screwed up.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

footprint