Code::Block Usage Under Ubuntu

本文介绍Code::Blocks,一个适用于Windows、Linux和MacOS的C/C++集成开发环境。虽功能不及Visual Studio强大,但在提高工作效率方面表现突出。文章详细讲解了项目创建、目录设置、链接库添加及预处理宏定义等操作,同时提供了Ubuntu环境下使用注意事项。

Code::Block is a C/C++ IDE that could run on different OS, Windows, Linux and Mac OS. Comparing to the VS under the windows, it is less powerful. But it will help you a lots, and improve the your work efficient if you were not an Linux coding expert. Graphics IDE always appear a lots of charming compared to the white text and black ground window. 

 

File –> New –> Project

A new project could be created as the above menu selection path.
open_projects 
Too many project templates, right? But do not worry, each template is just a “HelloWord”sample. You could code your project as many feature as more as possible.

 

Add Include directory, “Project”->”Build Option”

include_dir

 

Add link libraries directory, Project-> Build Options:

lib_dir

 
Add link libraries, Project –> Build Options:

link_lib

 

Add Pre-process Macros, Project –> Build Options:

macro

 

Goto File, Alt + G

goto_file

 

Something more
  • a) On the Ubuntu OS, the file path is case sensitive; The file path in #include command is case sensitive in Code::Block;
  • b) Do not mix .cpp and .c source files in Code::Block project. Otherwise you will come across some strange function calling link errors. You will see a error happen when you use a std::vector in a .c source file.
  • c) Do not add suffix for link libraries. For example, when you want to link OpenGL library, you need to add libGL instead of libGL.so.

转载于:https://www.cnblogs.com/open-coder/archive/2013/01/26/2877896.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值