www.digitalmars.com         C & C++   DMDScript  

c++ - BUG: Missing error message when linking an import library

I found this when testing GC.

If I forget to define the macro GC_DLL, the resulting gctest.exe ("sc
tests\test.c gc.lib -Iinclude -ogctest.exe" under dm\src\gc) will have an
application error when running. The error is clear when I build with MSVC:

test.obj : error LNK2001: unresolved external symbol _GC_all_interior_pointers
test.obj : error LNK2001: unresolved external symbol _GC_is_visible_print_proc
test.obj : error LNK2001: unresolved external symbol
_GC_is_valid_displacement_print_proc
test.obj : error LNK2001: unresolved external symbol _GC_arrays
gctest.exe : fatal error LNK1120: 4 unresolved externals

DMC really should have reported the same. My trace showed that the program
crashed exactly at the point accessing one of the symbols.

So I think DMC incorrectly converted a link-time error to a confusing run-time
error. I think it a bug.
Oct 07 2002