I would like to create a DLL, and the missing step so far is the linker.
I know how to do it using link.exe from Microsoft's Visual Studio, but
I would like to accomplish this task using free tools.
Basically I want to create message file DLL for event log logging, and I
am using three tools:
mc.exe ("free", from SDK)
rc.exe ("free", from SDK)
ld.exe (GNU :-) )
I'm first creating a .rc file using
C:\>mc MessageFile.mc
and then a resource (?) .res file using
C:\>rc -r -fo MessageFile.res MessageFile.rc
Then, I need to create the actual DLL using the linker. With Microsoft's
link.exe I do:
C:\>link.exe /DLL /OUT:msg.dll messagefile.obj MessageFile.res
which of course works fine. I'm quite unfamiliar with ld.exe but I tried
this:
C:\>ld.exe -dll -o msg.dll MessageFile.obj MessageFile.res
but I get the following output:
attempt to open Messagefile.obj succeeded
Messagefile.obj
attempt to open MessageFile.res succeeded
opened script file MessageFile.res
--> MessageFile.res: file not recognized: File format not recognized
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is ld.exe not able to read the .res file and link it? Am I missing
something else?
Any hints are appreciated, thanks!
Flo.
I suggest you look into MinGW (http://www.mingw.org/) which is a Win32
GNU toolchain including a resource compiler and scripts to build DLLs.
I frequently use it to make Win32 DLLs.