最近在学习linux下使用gcc。经同学推荐,现在使用Code::Blocks。这是一个集成开发环境(IDE),他没有自己编译器和调试器。如果你的操作系统使用的是fedora的话,在进入编程时,需要你设置一下Code::Blocks的compiler的路径。因为大多数的linux将gcc安装在/usr/lib下,而fedora是安装在/usr/bin下。具体方法:
CB工具条->Settings->Compiler and debugger settings->Toolchain executables
将compiler's installation directory输入框中的usr/lib改为:usr/bin。
注意:
1.toolchain executables这个选项在进入compiler and debugger settings时是被隐藏的,需要点击Search directories后面的“>”。
2.没有配置正确路径的会在编译并运行后出现错误提示:
"*(filename)- Debug" uses an invalid compiler. Skipping...
nothing have to do.