codeblocks can't find my compiler

落花浮王杯 提交于 2019-12-22 07:08:27

问题


OK, so I downloaded Codeblocks and I already have a cygwin terminal on my computer that I regularly use to compile and run C programs, but when I try to build a program in CodeBlocks, it gives me an error:

The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.

I don't know why it can't find my compiler or why it's looking for GNU GCC compiler when I have Cygwin GCC as the default compiler.


回答1:


I faced the same problem. I have fixed out by going to Setting -> Compiler -> Global Compiler Settings -> Toolchain Execuatables (tab). There, click on Program Files and then rename C compiler to gcc.exe and C++ compiler to g++.exe.




回答2:


I know this is an old question but let me see if I can help. First of all, on the download page make sure you downloaded codeblocks-13.12mingw-setup.exe and NOT codeblocks-13.12-setup.exe. Of course the version numbers may change but pay attention to the name. Then after installing codeblocks, go to Settings->Compiler->Toolchain executables. From here, change the C compiler to gcc.exe and C++ compiler to g++.exe. Hope this helps anyone else going through this problem :-)




回答3:


I think you have not set your compiler.You have to choose the compiler you want to use. For this purpose click 'Settings'-> 'Compiler and Debugger' and select 'Other Settings' in the drop-down field.Choose your own compiler and save it.Now rerun your program.




回答4:


Go to:

Settings -> Compiler... -> Toolchain executables(Tab)

In the compiler's installation directory choose the folder where your compiler is.

valter




回答5:


i have just solved the problem.

it happening because the path of you compilers is not correct in settings.code blocks downloads and installs compilers for you. you don not need to it manually. thus in some cases it takes wrong path of location of compilers.

now heres the solution:- 1. right click on code blocks and go to properties and copy its location,and open command promt tpye cd and past the location. if you know what this all about then just go to file where your code block is install.

2.you will found MinGW directory or folder.

3.right click on the folder, copy its location

4.open code blocks,go to settings which u will find in menu.

5.go to compilers and then go to toolchain executable

6.u will see compiler's installation directory past our location in white box below that.

  1. CLICK OK

you have solved ur problem. if this dose not work then try reinstalling




回答6:


I have just solved this problem.

In addition to above mentioned solutions , you can follow the path in "Setting -> Compiler -> Global Compiler Settings -> Toolchain Execuatables (tab)" and check the path for Compiler's installation directory. If it is blank, then click on "Auto Detect" tab. It will update the installation directory.




回答7:


I just solved the problem. Click 'Settings->Compiler and debugger->Toolchain executables'.Now in "Compiler's installation directory" click on 'Auto-detect' or browse to the path of compiler. It can be found usually at "C:\Program Files (x86)\CodeBlocks-EP\MinGW", if Codeblocks is installed in C-drive.




回答8:


I solved this problem I firstly downloaded codeblocks-17.12-setup.exe and then added MinGW directory location at Setting -> Compiler -> Global Compiler Settings -> Toolchain Execuatables (tab) -> compiler installation directory" but it did n't work then downloaded codeblocks-13.12mingw-setup.exe and did the same process again and it worked.




回答9:


If you change the default path of codeblocks while installation, then you may be suffering from this problem.

If you go to Settings>Global compiler settings>Toolchain executables(tab) and see the Compiler's installation directory, it may be set by default to C:\MinGW something like that.

Just press the Auto-detect button and it will find the actual directory of the compiler.

Click OK and you are ready to Code!




回答10:


I think the major problem is that most of us creates a project and then applies the Compiler's configuration and waits till the project applies the configured changes.

Will this is TOTALLY WRONG if you created the project before configuring the compiler the compiler won't change it's Compiler , so you need to reconfigure your created project by : Right Click on the project -> Select Build Options -> Reconfigure the selected compiler to CygwinGCC .



来源:https://stackoverflow.com/questions/22309491/codeblocks-cant-find-my-compiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!