I write a program with hex editing ability, but I don`t want RaHexEdit.dll to be near myprog.exe, so I try to link myprog.obj (created using /w32 /obj /coff options) with RaHexEdit.lib like this:
polink /SUBSYSTEM:WINDOWS /ENTRY:main myprog.obj hex.lib kernel32.lib user32.lib gdi32.lib comctl32.lib


As output I have myprog.exe (same size as when using with RaHexEdit.dll) which loads into the memory but nothing appears. I assume that static linking should increse size of .exe, but in my case it didn`t.

When I compile with only /w32 and LoadLibrary( "RaHexEdit.dll" ); everything works fine, but I don`t know what to do with LoadLibrary creating myprog.obj

I`m confused, please help.
Posted on 2006-12-15 06:16:23 by veach1
Sounds like your RaHexEdit.lib is an import library, not a static library...
Posted on 2006-12-18 17:03:41 by f0dder

Sounds like your RaHexEdit.lib is an import library, not a static library...


I wish I would know. It is RaHexEdit.lib that comes in the package with RaHexEdit.dll
Sizes are RaHexEdit.dll - 28,5kb and RaHexEdit.lib - 28,9kb
Posted on 2006-12-19 01:35:19 by veach1
Okay, I took a look at the files myself - there's certainly a static library version, 28.9kb RAHexEd.lib . My bad. To make sure the library is linked in and not discarded by the linker , as well as having necessary setup done, you'll need to call _RAHexEdInstall.
Posted on 2006-12-19 03:57:57 by f0dder
Thank you for helping!

Lazy me, not reading all given sources.

Now linker shows:
POLINK: error: Unresolved external symbol 'RAHexEdInstall'.
POLINK: fatal error: 1 unresolved external(s).

I`ve found on this messageboard topic about converting LIB file into OBJ files, maybe I should try this method, coze whatever I did before doesn`t help me. Every time I get errors about external symbols. I`m not a guru at all, I saw "includelib" and I think it`s the key, but nothing similar in C-- or FASM, should I rewrite my program in MASM? Is there some good web resources about static linking with good explanations and examples?

What I`m trying to reach - make my program independent from RaHexEd.dll, I don`t know what to do, I`m totally confused...
Posted on 2006-12-21 13:46:18 by veach1
How are you defining the prototype for RaHexEdInstall? Try this...

RAHexEdInstall PROTO C

Posted on 2006-12-21 16:58:22 by f0dder