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


基础教程推荐
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- CString 到 char* 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01