www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [BUG] Linker produces no output but returns 0

Hi all,

I've got a problem with DMD linker on Windows.

I've got one file written in C and one in D, both are attached.
I build a working executable on Linux without any problems using:

  $ gcc `sdl-config --cflags`   -c -o sdl.o sdl.c
  $ dmd -c stuff.d
  $ dmd sdl.o stuff.o -L-lSDL -L-lpthread -ofp1

I tried to build it on Windows. I downloaded dmd.2.035.zip, dmc.zip
and an SDL development package for Windows. The code was compiled
without problems:

  $ dmc sdl.c -c -I path/to/SDL/include -I /mingw/include
  $ dmd -c stuff.d

stuff.obj and sdl.obj were created. Adding "-I /mingw/include" was
necessary because without it compilation failed due to lack of
"strings.h" header file.

  $ dmd sdl.obj stuff.obj path/to/SDL.lib -ofp1.exe

The linker returned 0 but p1.exe was not built. A file called p1.map
was created though. I also tried the following command:

  $ link stuff+sdl,p1.exe,,path/to/SDL.lib

but the results were similar.

What might be a reason of this bug? Are you aware of such problems?

Best regards,
Jan Stępień
Oct 23 2009