نصب و نوشتن برنامه در code block
Setting up Code::Blocks and MINGW, A Free C and C++ Compiler, on Windows
Step 1: Download Code::Blocks
- Go to this website: http://www.codeblocks.org/downloads
- Follow the link to "Download the binary release" (direct link)
- Go to the Windows 2000 / XP / Vista / 7 section
- Look for the file that includes mingw in the name. (The name as of this writing was codeblocks-10.05mingw-setup.exe; the 10.05 may be different).
- Save the file to your desktop. It is roughly 74 megabytes.
Step 2: Install Code::Blocks
- Double click the installer.
- Hit next several times. Other setup tutorials will assume you have installed in C:\Program Files\CodeBlocks (the default install location), but you may install elsewhere if you like
- Do a Full Installation
- Launch Code::Blocks
Step 3: Running in Code::Blocks
Troubleshooting
The most common error people see if things don't work is a message like
"CB01 - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping..."
First, make sure that you downloaded the right version of Code::Blocks, the one that included MinGW. If that doesn't solve the problem, it is likely a problem with compiler auto-detection. Here's how you can check your current "auto-detected" state. Go to "Settings|Compiler and Debugger...". Then on the left, choose "Global Compiler Settings" (it has a gear icon) and on the right, select the "Toolchain executables" tab. This tab has a "Auto-detect" button that you can use. That might fix the problem--if it doesn't, you can manually fill out the form. Here's a screenshot demonstrating what things look like on my system. Change the path marked "Compiler's installation directory" if you installed to a different location, and make sure everything else is filled in as shown.
Once you've done that, try pressing F9 again to see if you get a running program.
Continue to Intro to C++ (or Intro to C).
- ۹۳/۰۴/۰۱