在linux的code::blocks编译器中,如何添加像“-lrt”这样的编译标志?或“-lboost_thread”?

发布于 2024-10-09 12:59:46 字数 119 浏览 0 评论 0原文

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

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 :/.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清风无影 2024-10-16 12:59:46

大家好,我想出了如何添加 -lrt。由于 -lrt 被传递给链接器而不是编译器,您可以转到“设置”->“编译器和调试器”->“链接器选项”,然后按“添加”,在执行“定位 lrt”后,我发现了这个可爱的库“/usr/lib/ libaticrt.so。”我在链接器选项中添加了库,现在这些错误消失了......是时候尝试 boost 了!

编辑:Boost 以类似的方式解决。 lboost_thread代表的库是libboost_thread.so。找到它的位置:“/usr/lib/libboost_thread.so”。将其添加到链接器选项中解决了问题:D

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文