madCHook static library usage with Visual Studio 2013

c++ / delphi package - dll injection and api hooking
Post Reply
manutai
Posts: 85
Joined: Sun Aug 03, 2008 1:40 am

madCHook static library usage with Visual Studio 2013

Post by manutai »

Hi,
We have licensed version of madcHook library which is a static library. We want to use this library with exe/dll complied in VS 2013 i.e we want to link this static library in VS 2013 executable. In general static library is compatible with the same version of VS for linking purpose. I tired to check the documentation to know VS version under which this static library is compiled but didn't get any information. Could you let us know if we can have madCHook compiled with VS 2013 or how compatible is this static library across various version of Visual Studio?

Regards
Sushil Kumar
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: madCHook static library usage with Visual Studio 2013

Post by madshi »

Hi there,

I've been using the same method to create static libs for years and nobody complained yet, so AFAIK the static libs are totally independent of the MSVC++ version. FYI, the 32bit static lib shipping with madCodeHook is created by a complicated process of compiling the Delphi source code into a DLL and then converting that to a static lib by using a 3rd party conversion tool. The 64bit static lib is created with MSVC++ 2005.
manutai
Posts: 85
Joined: Sun Aug 03, 2008 1:40 am

Re: madCHook static library usage with Visual Studio 2013

Post by manutai »

Hi,
Thanks for the response. I faced this problem many times when the old version C/C++ static libs were not linkabe in newer version of MSVC++. This becomes more error prone during run as well compile time when you use STL and other CRT/compiler constructs which are not portable with newer version of MSVC++. It is always better to use static lib compiled with respective compiler. To avoid this problem generally we make DLL and expose interface in base types of C/C++. I think Microsoft is best guy to throw more light on this compatibility.

We tried to compile given madCHook static lib with VS 2013 executable where compilation worked. I was worried about the run time unforeseen errors. As you are saying that people are using it with newer versions then we will also try it and come back if face any porblem.

Thanks
Sushil Kumar
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: madCHook static library usage with Visual Studio 2013

Post by madshi »

Yeah, STL/CRT can become problematic. But the way I'm compiling the static libs seems to be pretty much MSVC++ version independent, for whatever reason. Maybe I'm just lucky. In any case, it seems to work just fine. FWIW, I always recommend to start your own hook projects by using one of my demos as the starting point. That way you already have all the complicated MSVC++ compiler/linker settings set up correctly.
Post Reply