如何在Mingw中静态链接libwinpthread-1.dll? [英] how to do static linking of libwinpthread-1.dll in mingw?

查看:1027
本文介绍了如何在Mingw中静态链接libwinpthread-1.dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这里使用mingw:http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev2.7z/download

I use mingw from here: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev2.7z/download

并且我已经成功地通过使用-static-libgcc -static-libstdc++参数成功地静态链接了libstdc++-6.dlllibgcc_s_sjlj-1.dll,但是我找不到使用libwinpthread-1.dll进行相同操作的命令.

And I've sucessfully managed to link statically libstdc++-6.dll and libgcc_s_sjlj-1.dll by using -static-libgcc -static-libstdc++ parameters, but I cannot find a command for doing the same with libwinpthread-1.dll.

推荐答案

您可能应该查看GCC的命令行选项文档.

You should probably check command line options documentation for GCC.

这些不是'-static-something'命令,只能使用一个命令将标准库(libgcc和libstdc ++)设置为静态链接.对于其他库,您首先要切换为使用"-static"的静态链接,然后列出要包含在单独命令(即"-lpthread")中的库.

These's no '-static-something' command, only standard libraries (libgcc and libstdc++) can be set to static linking with one command. For other libraries, you first switch to static linking with "-static" and then list the libraries to include with separate commands, ie "-lpthread".

这篇关于如何在Mingw中静态链接libwinpthread-1.dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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