I am starting to work through "Jumping Into C++" by Alex Allain. The first exercise is a "hello world" program. I am posting this to help others in my position. I am running a Windows XP operating system on a 32 bit machine.
Prior to the fix below I kept getting the following message:
"Hello World C++ - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.
**********************************************
This is how to help yourself:
Realize that Code::Blocks is a code generating tool, and not a "compiler". You will need to download and install a compiler. One free example is "MinGW" available on the
www.mingw.org website. For the purpose of this discussion, I installed MinGW in C:/Program Files/MinGW. (it lakes a long to time to install and you will see a DOS screen with progress, so just realize that is OK).
Then....
You need to let Code::Blocks know where your compiler is. Under "Settings" pull down and select "Compiler and Debugger..." and in the window that pops up select the "Toolchain Executables" tab.
For the "Compiler installation directory" I put "C:/Program Files/MinGW" (remember that is where I had put MinGW).
For the specific program files use the "..." button to browse to the "bin" directory (in my case) C:/Program Files/MinGW/bin and select the following files:
C compiler: select > mingw32-gcc.exe
C++ compiler: select > mingw32-c++.exe
Linker for dynamic: select > mingw32-g++.exe
Linker for static: select > ar.exe
Debugger: select > gdb.exe
Resource compiler: select > windress.exe
Make program: select > mingw32-make.exe
I could make this fix work for me when I did it as described, and then I could re-create the error by "messing it up a little."
This post is in compliance with the site rules because it deals with how to set "Code::Blocks". Also, considering the amount of posts that were asking for this information, may I respectfully request that you consider just leaving this post to help people get past the initial "deer in headlights" phase?
.....We were all green once. Please be patient with us mortals.