www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Where does the Windows mingw libs come from ?

reply user1234 <user1234 12.de> writes:
If I use those coming with the mingw64 proposed by a linux 
package manager, manually linking a betterC object containing a 
simple main fails with an error about "undefined mainCRTStartup".

But if I use those coming from ldc2 64 bit windows distribution 
that works perfectly.

command is

```
$ lld-link /NOLOGO /OPT:REF /OPT:ICF /SUBSYSTEM:WINDOWS 
/ENTRY:mainCRTStartup\
  /errorlimit:0 /OUT:a.exe /LIBPATH:$LP\
  /DEFAULTLIB:$DL\
  .main.o
```

with LP either
- /usr/x86_64-w64-mingw32/sys-root/mingw/lib (not working version)
- /home/xx/bin/ldc2-/lib/mingw (copied from the ldc2 win release)

and DL either
- libvcruntime140_app.a (not working version)
- vcruntime140 (ldc2 one)

So I wonder where do your mingw libraries come from ?
Jun 05 2022
parent reply kinke <noone nowhere.com> writes:
On Monday, 6 June 2022 at 00:15:56 UTC, user1234 wrote:
 So I wonder where do your mingw libraries come from ?
They're from https://github.com/ldc-developers/mingw-w64-libs; see its README.md for details.
Jun 05 2022
parent user1234 <user1234 12.de> writes:
On Monday, 6 June 2022 at 00:43:32 UTC, kinke wrote:
 On Monday, 6 June 2022 at 00:15:56 UTC, user1234 wrote:
 So I wonder where do your mingw libraries come from ?
They're from https://github.com/ldc-developers/mingw-w64-libs; see its README.md for details.
thanks, the work done on your version of vcruntime140.lib is valuable.
Jun 07 2022