将链接器选项添加到 Code::Blocks

2022-01-11 00:00:00 linker c++ codeblocks libgcc

当我尝试在我的 Win 7 x64 机器上运行使用 Code::Blocks 编译的可执行文件时,它说它无法运行,因为缺少 libgcc_s_dw2-1.

When i try to run an executable compiled with Code::Blocks on my Win 7 x64 machine, it says it cannot run because the libgcc_s_dw2-1 is missing.

我找到了一个解决方案,将库包含在链接器选项中.(这是我从中得到的参考:http://forums.codeblocks.org/index.php?topic=16748.0;prev_next=prev.看最后一篇)

I found a solution, to include the library in the linker options. (here is the reference i got it from: http://forums.codeblocks.org/index.php?topic=16748.0;prev_next=prev. look at the last post)

问题是,当我转到链接器设置时,在项目构建选项中,那里没有可用的库.需要下载吗

The thing is, when i go to the linker settings, in Project Build Options, there are no libraries available there. Do i have to download the

-static-libgcc
-static-libstdc++

如帖子所述,并将它们放在一个目录中以便 Code::Blocks 可以看到它们并将它们添加到链接器选项中?如果是,我将这些库放在哪里?

as stated by the post, and put them in a directory so Code::Blocks can see them and add them to the linker options? If yes, where do i put the libraries?

推荐答案

没关系,我在这篇文章中找到了答案http://forums.codeblocks.org/index.php/topic,15998.0.html

Never mind, i found the answer in this post http://forums.codeblocks.org/index.php/topic,15998.0.html

总结一下,在代码块中,转到

To sum up, in Code Blocks, go to

"Settings" -> "Compiler and debugger..."
"Global compiler settings"
"Linker settings"

然后将以下选项添加到`"Other linker options":

Then add the following options to `"Other linker options":

-static-libgcc -static-libstdc++

那你就走了……

相关文章