Adding linker options to Code::Blocks(将链接器选项添加到 Code::Blocks)
问题描述
当我尝试在我的 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++
那你就走了……
这篇关于将链接器选项添加到 Code::Blocks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将链接器选项添加到 Code::Blocks


- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 近似搜索的工作原理 2021-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- STL 中有 dereference_iterator 吗? 2022-01-01
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- C++ 协变模板 2021-01-01
- 从python回调到c++的选项 2022-11-16
- Stroustrup 的 Simple_window.h 2022-01-01
- 如何对自定义类的向量使用std::find()? 2022-11-07
- 静态初始化顺序失败 2022-01-01