October 08, 2002 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. |
Copyright © 1999-2021 by the D Language Foundation