Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Linking DLL with resource file .res

294 views
Skip to first unread message

Florian

unread,
Apr 14, 2005, 12:57:41 PM4/14/05
to
Hi,

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.

toby

unread,
Apr 16, 2005, 7:33:56 PM4/16/05
to

Florian wrote:
> Hi,
>
> 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....

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.

0 new messages