Page 1 of 1

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

Posted: Wed Aug 28, 2013 9:22 am
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.

Paul

/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

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

Posted: Wed Aug 28, 2013 10:49 am
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.

Thanks,
Phil