User forums > Help

Can't find compiler executable in your search path...

(1/1)

royalbox:
Hello.
I've set code::blocks up to use the MS compiler but am still getting the error when compiling:
"Can't find compiler executable in your search path for GNU GCC compiler"

Do I still need to install code::blocks with the MINGW compiler? I had this installed and it worked. I decide I would stick with code::block and uninstalled my other compilers, had a bit of a cleanout, and re-installed code:blocks without the MINGW compiler.

Any ideas?

Many thanks.

thomas:
You do not need MinGW to use the Microsoft compiler.

The error message you cite looks like you have set MinGW as your default compiler or as the compiler to be used in the project (or both). In that case, the IDE will try to run the GNU compiler rather than the MSVC one, and since that is not installed, it will of course not find it.

Make sure that
a) your MSVC compiler is installed correctly (I assume that is the case)
b) both under Compiler -> Compiler options as well as under your project options, it says "Microsoft Visual C++" under "selected compiler" on top
c)  under Compiler -> Compiler options, the "Programs" tab lists the correct locations of your build tools - if it does not, try "auto-detect", if that still does not work, enter the location by hand

Then it should find the correct executables.

To preempt another pitfall with MSVC, please make sure you have the platform SDK downloaded, too, or else you won't be able to build Windows programs. The "normal" MSVC package that you download from the net does not contain that.
   

royalbox:
Thomas,
Thanks a lot. The problem was under the projects options. It said that the selected compiler was the MS one until I clicked on "default" in the tree on the left, which then showed the GNU one. I got other errors I need to sort out but at least that's cleared that one up.

Thanks again.

rickg22:
I think we should get rid of that "default compiler" since it's annoying and confusing. How about a dialog like this:

Please choose the compiler you'd like for this target:

* MinGW
* MSVC
* etc

[] Use this compiler for all targets (don't ask again for this project)

See, if Code::Blocks comes with MinGW, it'll use this as the "default", and that's not what MSVC users would want. So getting rid of the "default" option would be better. Of course, saving the last chosen option for future projects is required.

mandrav:
Not really needed.
Just a global setting for the default compiler, sounds enough.
Also, don't forget that in the CVS version, the new project wizard already creates the project using the default compiler setting. So, no confusion anymore...

Navigation

[0] Message Index

Go to full version