i've got some free time in the past few days, so
i've been messing with the Open Watcom multi-format linker. i'm trying to
link some COFF-format files in with my project.
i'm just having trouble getting the damn thing to
link correctly, period, let alone link in other formats. i'm using a very
simple program:
[dtest.d]
import std.stdio;
void main()
{
int x=5;
writefln(x);
}
and i'm compiling with the -c flag so it doesn't
use the OPTLINK linker.
i then link with the following command (for those
not familiar with DOS, %var% is the same as $(var))
set LINK=\dmd\bin\wlink
set PROG=dtest
%LINK% LIBP \dmd\lib LIBP \dm\lib FORM
WIndows F %PROG%.obj LIBF kernel32.lib N %PROG%
i have to use the LIBF kernel32.lib or else it
gives a lot of undefined references.
the weird thing is that it compiles and links just
fine, but the final EXE is unrunnable. i run it and it gives a cryptic
message about something called BaseAttachCompleteThunk not being found in
kernel32.dll.
has anyone had any better luck with this?
most of the options in the linker are way over my head, and i have no idea what
i'm missing.
again i lament - WHY OH WHY COULDN'T WALTER JUST
USE COFF ;)