我有依赖于 boost 和其他库的 C++ 代码,因此该代码有一个调用 boost 的 makefile。
我现在正尝试在 linux 的 CodeBlocks 中开始开发此代码,因此我有两个基本问题:
(1) 如何将代码作为 CodeBlocks 新项目导入 CodeBlocks?这似乎是一个很好的记录:http://www.programmingforums.org/thread44976.html
(2) 如何使用 CodeBlocks 而不是 CodeBlocks 来调用 makefile 来尝试编译代码(由于 CodeBlocks 不知道它需要调用 boost,因此会失败)?
最佳答案
如何将代码作为代码块新项目导入代码块?
文件 > 新建 > 项目 > 空项目
创建项目,然后:
- 右键单击“项目” Pane 中的项目名称;
- 递归添加文件。
我建议您在源代码的顶层创建 Code::Blocks 项目新项目(而不是例如在专用的 ~/codeblocks
目录中),否则它将显示长文件路径。
如何使用代码块而不是代码块来调用 makefile 来尝试编译代码(由于代码块不知道它需要调用 boost,因此会失败)?
提问于:Is it possible to use an existing Makefile to build a project in Code::Blocks? .为了快速引用,解决方案是转到 Project > Properties 并打开选项 This is a custom Makefile。可以在同一窗口中指定更多选项。
关于c++ - 如何从外部代码和 Makefile 启动 CodeBlocks 项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13517938/