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
基础教程推荐
- 从 std::cin 读取密码 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01