Pelles C forum

C language => Expert questions => Topic started by: unwake on April 10, 2026, 04:09:53 AM

Title: Link error with minhook
Post by: unwake on April 10, 2026, 04:09:53 AM
https://github.com/TsudaKageyu/minhook/releases/tag/v1.3.4
Minhook has dynamic and static lib, link with dynamic lib is ok, but link with static lib "libMinHook.x64.lib", say error:
POLINK: fatal error: Unsupported anonymous format in object 'x64\Release\libMinHook\hook.obj'.
can you fix it ?
Title: Re: Link error with minhook
Post by: TimoVJL on April 10, 2026, 08:57:10 AM
That ANON_OBJECT_HEADER is a problem for linking.
Check library with pope.exe
Title: Re: Link error with minhook
Post by: Vortex on April 10, 2026, 09:52:04 AM
Sorry but is it allowed to discuss about API hooking in this forum?
Title: Re: Link error with minhook
Post by: Pelle on April 11, 2026, 03:36:43 PM
Quote from: unwake on April 10, 2026, 04:09:53 AMhttps://github.com/TsudaKageyu/minhook/releases/tag/v1.3.4
Minhook has dynamic and static lib, link with dynamic lib is ok, but link with static lib "libMinHook.x64.lib", say error:
POLINK: fatal error: Unsupported anonymous format in object 'x64\Release\libMinHook\hook.obj'.
can you fix it ?
I can't find any documentation about this format (I'm guessing this is a some semi-new Microsoft crap, and with their documentation department being years behind everyone else, maybe not surprising). I will keep looking, but with no proper documentation I'm not sure what I can do...

EDIT: after some testing, this looks like MSVC link-time code generation. This library can only work with Microsoft tools ...

Title: Re: Link error with minhook
Post by: Pelle on April 11, 2026, 03:39:53 PM
Quote from: Vortex on April 10, 2026, 09:52:04 AMSorry but is it allowed to discuss about API hooking in this forum?
Like many other things, this can be used for both good and bad.
It depends on the context. So far I see nothing out of line here...
Title: Re: Link error with minhook
Post by: ander_cc on April 21, 2026, 12:37:06 PM
You can compile it to static lib with pelles c. but do not add MinHook.def and MinHook.rc to project.
I try it and it works.

If you add MinHook.rc file can get follow error. I donot know why.
*** Error:   "D:\minihook\dll_resources\MinHook.rc" -Fo"D:\minihook\output\MinHook.res"


Title: Re: Link error with minhook
Post by: John Z on May 11, 2026, 01:38:00 PM
Hi ander_cc,

Try this version of MiniHook.rc might work -

John Z