Static Linking of inpout32.lib (how to do that)

My x64 port of InpOut32
Post Reply
New User
Posts: 4
Joined: Wed Aug 28, 2013 8:10 am

Static Linking of inpout32.lib (how to do that)

Post by Paul_Kussmaul »

Hi Phil,

I am working with Win7 (64bit) and VS2012. I would like to link inpout32.lib statically. The LIB is listed in the argument-list for the linker (see full linker command-line below), but when I run my EXE, it is still asking for inpout32.dll. I have tried to put the inpout32.dll in System32, but this does not help. It only works, if I put the inpout32.dll in the directory where my EXE lives! Any hints how inpout32.lib needs to be linked into my EXE? I need the incorporated version for my final application.

Thanks for providing this library, your idea with the switching installer is excellent. Your solution is much more comfortable than nt-port-lib which I had used before.


/OUT:"Debug\RbtTool.exe" /MANIFEST /PDB:"Debug\RbtTool.pdb" /DYNAMICBASE:NO "..\..\pc_if\lib\inpout32.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /SAFESEH:NO /INCREMENTAL /PGD:"Debug\RbtTool.pgd" /SUBSYSTEM:CONSOLE",5.01" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Debug\RbtTool.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1

User avatar
Site Admin
Posts: 6627
Joined: Sun Apr 06, 2003 11:12 pm

Re: Static Linking of inpout32.lib (how to do that)

Post by phil »

InpOut32 is NOT a library, it is a DLL. Therefore it cant be linked "in to" your EXE, it can only be referenced and loaded by your EXE. You can of course link to the DLL at build time (load time linking) although I personally think dynamic runtime linking is the best bet because you can handle the fact that the DLL can not be loaded and inform/proceed from there.

The DLL needs to live somewhere in the path (ideally in the same folder as your EXE but it should work if it is in the system32 (or syswow64 folder for a 32bit application)).

The source code is available so you may be able to convert it to a library, but I dont know if that will work because of the resources and particularly the drivers that are embedded in the file.

--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

Post Reply