在linux的code :: blocks编译器中,如何添加编译标志,如'-lrt'或'-lboost_thread'? [英] In the code::blocks compiler for linux, how can one add compilation flags like '-lrt' or '-lboost_thread'?

查看:557
本文介绍了在linux的code :: blocks编译器中,如何添加编译标志,如'-lrt'或'-lboost_thread'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在gdb中调试对我来说不方便,所以我喜欢code :: blocks提供的很好的调试接口。现在我已经将项目移动到需要这些标志的区域(当然是标题中的标志),我发现我无法再编译code :: blocks:/。

解决方案

大家好,我想出了如何添加-lrt。因为-lrt被传递给链接器而不是编译器,所以你可以进入Settings-> Compiler and Debugger->链接器选项,然后按下add和在做一个locate lrt之后,我发现这个可爱的库/ usr / lib / libaticalrt。所以。我在链接器选项中添加了库,现在这些错误消失了......时间来尝试提升!

编辑:Boost以类似的方式解决。由lboost_thread表示的库是libboost_thread.so。一个定位找到它:/usr/lib/libboost_thread.so。在链接器选项中添加它解决了问题:D

Debugging in gdb is not convenient for me so I enjoy the nice debugging interface that code::blocks offers. Now that I have moved my project into an area where those flags are required (the ones in the title, of course), I find that I can't compile on code::blocks anymore :/.

解决方案

Hi everyone I figured out how to add the -lrt. Since -lrt is passed to the linker and not the compiler you can go to Settings->Compiler and Debugger->linker options then press add and after doing a "locate lrt" I found this cute library "/usr/lib/libaticalrt.so." I added the library in the linker options and now those errors disappeared... Time to try boost!

EDIT: Boost was solved in a similar manner. The library represented by lboost_thread is libboost_thread.so. A locate found it at: "/usr/lib/libboost_thread.so." Adding it in the linker options solved the problem :D

这篇关于在linux的code :: blocks编译器中,如何添加编译标志,如'-lrt'或'-lboost_thread'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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