在linux的code::blocks编译器中,如何添加像“-lrt”这样的编译标志?或“-lboost_thread”?
在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大家好,我想出了如何添加 -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