Code::Blocks is an Integrated Development Environment (IDE) used by many C++ software engineers and developers. An IDE is like a text editor with added features. It runs on the major platforms.
Solve Some Code::Blocks Problems Contents • • • • Update to Code::Blocks Command Locations Newer releases of Code::Blocks may change some of the locations of key commands referenced in the book. This is more of an issue with Code::Blocks than my book, but if you send me any discrepancies I'll happily place them on the book's. The Man Page viewer may not be found in some releases of Code::Blocks. That's okay; the version I wrote about in the book was rather unreliable when it came to displaying the man pages. Getting a Mac Compiler If you don't have Xcode, or Apple won't let you download Xcode because your OS X is too old, then you can obtain the clang compiler directly. Download a clang release that matches your version of OS X, or the binaries for Mac OS X for an older version of clang. In Code::Blocks you need to set clang as the compiler of choice.
![For For](https://d2.alternativeto.net/dist/s/codeblocks_556335_full.jpg?format=jpg&width=1200&height=1200&mode=crop)
In Code::Blocks, choose Settings > Compiler. Choose LLVM Clang Compiler from the menu button.
Code::Blocks Won't Compile or Loses the Source Code If you're having trouble getting Code::Blocks to compile, then you may have an issue with its installation. Specifically, Code::Blocks may be unable to find the proper directory for the compiler. Here are the steps to remedy the situation: • Open a Windows Explorer window (shortcut: Win+E) • Navigate to the compiler's bin folder, such as C: Program Files (x86) CodeBlocks MinGW bin • Right-click in the address bar and choose the command Copy Address. • Start Code::Blocks • Press Ctrl+Shift+N to start a new, empty file. • Choose Settings > Compiler to display the Compiler Settings dialog box. • Click the tab Toolchain Executables.
• Paste the copied address into the Compiler's Installation Directory text box. • Click the OK button to set the location. The video (below) visually describes how to address this issue. What is the -s Option and Why is It Obsolete? You may see a linker warning on some Code::Blocks installations. It reads: warning: option -s is obsolete and being ignored I've seen this message appear primarily on Macintosh installations. Because it's a warning, the code does compile.
In fact, there's nothing wrong with the code or the program; the message is just a warning because an old option was set. Here's the man page for the ld (linker) command regarding the -s option: -s Completely strip the output, including removing the symbol table.
![Codeblocks For Mac Codeblocks For Mac](https://a.fsdn.com/con/app/proj/codeblocks/screenshots/291165.jpg/245/183/1)
This file format variant is no longer supported. This option is obsolete. I'm unaware of how to disable this warning, although I'm sure a switch that does the trick is hidden somewhere in Code::Blocks, where the linker options are set. When I find that location, I'll post a solution here.
Code::Blocks 作为一款轻量级的C/C++ IDE,它除了能够完成最基本的编辑、编译、调试的功能,还具备以下特点: • 开源 每次看到这个词就莫名的激动,特别是对于学生朋友们,囊中羞涩的你再也不用因为使用盗版软件受到内心的谴责。有免费的我们为什么一定要选择花钱呢。 • 跨平台、跨编译器 Windows、Linux、Mac OS都可以使用,即使将来更换了设备也无需担忧。 支持多款编译器,只要简单配置一下就可以轻松切换gcc/g++、Visual C++、Borland C++、Intel C++等20多款编译器。 • 插件式框架 初学者可能无法理解框架的概念,简单说就是方便添加各种有的没的小功能。 • 采用C++写成 运行环境非常简单,不用安装其他庞杂的Framework。 • 升级频繁与维护良好 几乎每个月都有升级包,还有各种热心网友提供功能包。 • 内嵌可视化GUI设计 IDE的图形界面,采用wxWidgets,如果你听不懂的话只要知道很牛X就可以了。 下载 CodeBlocks的官方下载页面: 选择你需要的平台和版本。由于CodeBlocks的Debug过程基于Linux的GDB,最好选择带有mingw字样的版本。 有时,官网下载页面会出错,那么只能到第三方平台寻找安装程序了,如: 安装.