Linking not working properly Windows 11

Hipreme msnmancini at hotmail.com
Sat Nov 5 14:54:52 UTC 2022


On Saturday, 5 November 2022 at 14:14:16 UTC, bauss wrote:
> On Saturday, 5 November 2022 at 13:42:08 UTC, rikki cattermole 
> wrote:
>> Try ldc, if that works then its just a missing library that 
>> needs to be linked against regarding MS CRT.
>
> Using LDC doesn't seem to work either, it has similar linking 
> problems.
>
> ```
> lld-link: error: undefined symbol: fileno
>>>> referenced by 
>>>> druntime-ldc.lib(dmain2.obj):(_d_print_throwable)
>>>> referenced by 
>>>> phobos2-ldc.lib(stdio.obj):(_D3std5stdio4File4syncMFNeZv)
>>>> referenced by 
>>>> phobos2-ldc.lib(stdio.obj):(_D3std5stdio4File13windowsHandleMFNdZPv)
>>>> referenced 18 more times
>
> lld-link: error: undefined symbol: execv
>>>> referenced by 
>>>> phobos2-ldc.lib(process.obj):(_D3std7process6execv_FIAyaIAQfZi)
>
> lld-link: error: undefined symbol: execve
>>>> referenced by 
>>>> phobos2-ldc.lib(process.obj):(_D3std7process7execve_FIAyaIAQfIQeZi)
>
> lld-link: error: undefined symbol: execvp
>>>> referenced by 
>>>> phobos2-ldc.lib(process.obj):(_D3std7process7execvp_FIAyaIAQfZi)
>
> lld-link: error: undefined symbol: execvpe
>>>> referenced by 
>>>> phobos2-ldc.lib(process.obj):(_D3std7process8execvpe_FIAyaIAQfIQeZi)
>
> lld-link: error: undefined symbol: tzset
>>>> referenced by 
>>>> phobos2-ldc.lib(timezone.obj):(_D3std8datetime8timezone9LocalTime9singletonFNeZ12__dgliteral4MFNaNbNiNfZOb)
> Error: linking with LLD failed
> ldc2 failed with exit code 1.
> ```
>
> Not sure what to do at this point.

Just posted the other day how to use the MSVC Linker on windows. 
Using LLD is quite complicated in my experience because I was 
getting a lot of undefined symbols from the libcmt.

Check this post: 
https://forum.dlang.org/thread/frixfbbucsbgcrsvmjtf@forum.dlang.org

Remember that for using the MSVC Linker you will need to have 
visual studio build tools on your PC (or install the visual 
studio with desktop development with C++).
Then you can modify your `sc.ini` and it should work.



More information about the Digitalmars-d-learn mailing list