MSVCRT可以静态连接mingw吗? [英] Can I link MSVCRT statically with mingw?

查看:370
本文介绍了MSVCRT可以静态连接mingw吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有C程序,我在Windows上使用 mingw 编译。它工作正常,但需要 MSVCRT.DLL 。我想静态链接(像我在Visual Studio中可以做到的)。这是可能吗?



我尝试了 -static 标记为 gcc 并没有发生任何变化。



C ++程序使用标准C ++库怎么办?

解决方案

我认为MinGW不会因为版权原因使用静态运行时库。



你可以尝试使用newlib http://sourceware.org/newlib/ )创建一个不链接到<$ c的可执行文件$ c> msvcrt.dll


I have C program I compile with mingw on Windows. It works fine but requires MSVCRT.DLL. I want to link that statically (like I can do in Visual Studio). Is this possible?

I tried -static flag to gcc and it didn't make any change.

What about C++ program using also standard C++ library?

解决方案

I believe that MinGW doesn't use the static runtime library for copyright reasons.

You can maybe try to use newlib (http://sourceware.org/newlib/) to create an executable that doesn't link to msvcrt.dll

这篇关于MSVCRT可以静态连接mingw吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆