在 2020/8/27 下午1:18, Vincent Torri 写道:
>>
>> In 'mingw-w64-crt/crt/crtexe.c' , `argv` is initialized by the function 
>> `__getmainargs()` which is imported from MSVCRT. VC
>> uses new versions of runtime libraries so it'd be MSVCR100, MSVCR120, etc. 
>> There might be some differences in the
>> aforementioned function.
> 
> that makes sense. Is it possible to tell gcc to use msvcr*.dll instead
> of msvcrt.dll ?
> 

The MSYS2 GCC has a patch [1] for the option `-mcrtdll=`. You may try compiling 
with `-mcrtdll=msvcr140` for example. You
probably have to check which version your MSVC uses first.

Note that in principle this patch is incorrect. If you want to link against a 
different CRT DLL then everything - including
all indeterminate DLLs - has to be re-compiled. It is not safe to link one DLL 
against MSVCRT and another one against
MSVCR120 and load them in the same process.


[1] 
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/0006-Windows-New-feature-to-allow-overriding.patch


-- 
Best regards,
LH_Mouse

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to