Thread overview
Newbie linker errors - still missing _fltused _tls_index _tls_used localtime tzset mainCRTStartup
September 07
I just ported my Java application to D, got it to compile, but not to link.

I'm using Windows 10 64 bit, DMD 2.088.0 , Visual D 0.50.1.  This would be a C/C++ project in Visual Studio with only D code.

With my first attempt, I'm missing 65 externals, 328 errors.

I added these two files

ucrt.lib
vcruntime.lib

to the Additional Dependencies in the linker property pages and have my missing external count down to 6, 70 errors.

I'm missing the following 6 symbols:

_fltused _tls_index _tls_used localtime tzset mainCRTStartup

What other libs would I need to add to the linker's additional dependencies?
September 08
PS:  Here are the actual linker errors:

1>phobos64.lib(gc_23c0_122.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(ti_float_2680_3f3.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(hash_d99_76c.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(typeinfo_2629_49b.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(demangle_c1d_79b.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(parseoptions_dbf_7cf.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(gc_23bb_583.obj) : error LNK2001: unresolved external symbol _fltused
1>dcompile_ACME.obj : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(ti_double_267f_3f1.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(hash_d90_7d1.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(hash_da7_5fe.obj) : error LNK2001: unresolved external symbol _fltused
1>phobos64.lib(thread_cae_681.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_cb1_5f2.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23e3_142b.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime_2517_713.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(exception_c7a_fff.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_cac_6f2.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23df_13c3.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23e0_687.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23e1_687.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23e2_e95.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23db_12f9.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23dc_1319.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23dd_12df.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23de_12a7.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d5_2117.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d7_1ed1.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d8_13ee.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d9_114b.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d1_10bd.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d2_12c9.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d3_12c9.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d4_1e85.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23bb_583.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23c0_122.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23cf_e95.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(gc_23d0_e95.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(advapi32_3e23_45c.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(tlsgc_25a3_1b4.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(advapi32_3e22_45a.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(sections_win64_2590_507.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(deh_win64_posix_24d8_6ee.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_cd3_864.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_cbe_6a3.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(registry_3d3f_4ba.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(exception_c79_d6c.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(exception_c77_1702.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_c9d_48b.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_c9a_713.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(profilegc.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_c9c_258.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(dll.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(thread_cc0_1e8.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(exception_c78_b74.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime_2515_4a3.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(profilegc_2587_424.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(concurrency_2ec9_3e4.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime_251a_7db.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime_2537_6c8.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(exception_c76_133e.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime.obj) : error LNK2001: unresolved external symbol _tls_index
1>dcompile_ACME.obj : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(deh_win64_posix_24dd_3b9.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime_2534_7cc.obj) : error LNK2001: unresolved external symbol _tls_index
1>phobos64.lib(lifetime_2533_763.obj) : error LNK2001: unresolved external symbol _tls_index
1>LINK : error LNK2001: unresolved external symbol mainCRTStartup
1>phobos64.lib(timezone_3710_37a.obj) : error LNK2019: unresolved external symbol localtime referenced in function "const nothrow @trusted bool std.datetime.timezone.LocalTime.dstInEffect(long)" (_D3std8datetime8timezone9LocalTime11dstInEffectMxFNbNelZb)
1>phobos64.lib(timezone_3710_37a.obj) : error LNK2019: unresolved external symbol tzset referenced in function "nothrow @nogc @safe bool std.datetime.timezone.LocalTime.singleton().__lambda3()" (_D3std8datetime8timezone9LocalTime9singletonFNeZ9__lambda3FNbNiNfZb)
1>phobos64.lib(sections_win64_2590_507.obj) : error LNK2019: unresolved external symbol _tls_used referenced in function "nothrow @nogc void[] rt.sections_win64.initTLSRanges()" (_D2rt14sections_win6413initTLSRangesFNbNiZAv)
1>C:\Users\...\PROJECT.exe : fatal error LNK1120: 6 unresolved externals


September 08

On 08/09/2019 00:30, malpropism wrote:
> I just ported my Java application to D, got it to compile, but not to link.
> 
> I'm using Windows 10 64 bit, DMD 2.088.0 , Visual D 0.50.1.  This would be a C/C++ project in Visual Studio with only D code.
> 
> With my first attempt, I'm missing 65 externals, 328 errors.
> 
> I added these two files
> 
> ucrt.lib
> vcruntime.lib
> 
> to the Additional Dependencies in the linker property pages and have my missing external count down to 6, 70 errors.
> 
> I'm missing the following 6 symbols:
> 
> _fltused _tls_index _tls_used localtime tzset mainCRTStartup
> 
> What other libs would I need to add to the linker's additional dependencies?

I suspect you have disabled the C runtime library selection in the D compilation options to build against the shared C runtime DLLs (you can select that, too). Or your code might be missing a main function in which case the selection might not be embedded into any object file.

In this case, you should add msvcrt.lib instead of vcruntime.lib. Depending on used functionality you will also need legacy_stdio_definitions.lib.