how to convert a source code on code ::blocks into a program (.exe)
how to convert a source code on code ::blocks into a program (.exe)
Create a project. Add the source files (with a .c extension for C source, .cc or .cpp for C++ source files, don't add header files with a .h extension) to your project. Set project options if you are using any third party libraries. Build the project.
If the build process fails, it will (most likely) either be because of compilation errors (syntax errors in a source file) or linking errors (missing libraries, multiply defined symbols, functions called without being implemented anywhere). Those are errors the programmer is expected to correct.
You realise you could have worked this out in a few minutes by reading the Code::Blocks documentation? After all, the purpose of Code::Blocks is to support the building of programs (and various related processes). So this type of basic stuff is pretty well documented - if you care to look.
Remember Code::Blocks is NOT a compiler!!
You need to have a Compiler installed to compile code!
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
I'm just considering learning C++. On this page: C and C++ Compiler Information and Reviews - Cprogramming.com, Code::Blocks is listed as a compiler. Why do you say it is 'NOT a compiler!!'?
Because it IS NOT a compiler!!!
FAQ-General - CodeBlocks
Note, CB also may NOT contain a Compiler for windows!Q: What Code::Blocks is not?
A: Code::Blocks is not a compiler, nor a linker. Release packages of Code::Blocks may include a compiler suite (MinGW/GCC), if not provided by the target platform already. However, this is provided "as-is" and not developed/maintained by the Code::Blocks development team.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
More specifically, Code Blocks is an IDE.
editor compiler and debugger, basic toolchain for developing software. Code blocks is an IDE which means you get those three things in one installation, if of course you choose that particular installation - you can just have the editor for example
Thought for the day:FLTK: "The most fun you can have with your clothes on.""Are you sure your sanity chip is fully screwed in sir?" (Kryten)
Stroustrup:
"If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"
In other words, when you first download it, you have to make sure you get the larger package with "mingw" in the title, as this is both compiler and IDE rolled into one easy install.
Download binary
codeblocks-12.11-setup.exe
codeblocks-12.11-setup_user.exe 28 Nov 2012 28.2 MB
codeblocks-12.11mingw-setup.exe
codeblocks-12.11mingw-setup_user.exe 28 Nov 2012 96.8 MB
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Ah! Thanks all. I have some experience programming in HTML, PHP and javascript. My scripts are very complicated for a novice but a real programmer could write them in his sleep. Getting a PHP server installed was tough enough. Understanding the C++ programming environment is quite daunting.