Перейти к содержимому

Codeblocks can t find compiler executable что делать

  • автор:

Проблема с CodeBlocks не запускает программы

Установите компилятор.
Или скачайте сборку вместе с компилятором.

Отслеживать
ответ дан 28 окт 2013 в 18:00
128 8 8 бронзовых знаков
Я скачал и установил codeblocks-12.11mingw-setup_user.exe
29 окт 2013 в 3:51

@Nikfilv, сейчас не могу посмотреть, там должны быть настройки компилятора. Как-то нужно отключить Watcom и включить MinGW

29 окт 2013 в 4:36
Можно подробнее?
29 окт 2013 в 11:05
Меню Settings — Compiler — Выбрать GNU GCC — Нажать set as default?
29 окт 2013 в 17:55
Спасибо, всё получилось.
31 окт 2013 в 11:08

В настройках где компилятор сбросил настройки — Reset defaults, и мне помогло. Еще галку на желаемый компилятор.

Отслеживать
ответ дан 17 мар 2019 в 8:56
11 1 1 бронзовый знак

  • codeblocks
  • компиляция
  • c++
    Важное на Мете
Похожие

Подписаться на ленту

Лента вопроса

Для подписки на ленту скопируйте и вставьте эту ссылку в вашу программу для чтения RSS.

Дизайн сайта / логотип © 2024 Stack Exchange Inc; пользовательские материалы лицензированы в соответствии с CC BY-SA . rev 2024.1.3.2953

Нажимая «Принять все файлы cookie» вы соглашаетесь, что Stack Exchange может хранить файлы cookie на вашем устройстве и раскрывать информацию в соответствии с нашей Политикой в отношении файлов cookie.

Code::Blocks Troubleshooting Tips

One of the most common problems that students have had with Code::Blocks is that after it has been first set up it won’t run the compiler. There are a number of possible causes:

  1. There is no compiler installed.
    Code::Blocks is mainly just a user interface. It requires a separtate compiler and C++ libraries to do the actual compiling, linking, and debugging. In the Code::Blocks setup menu this is referred to as a «toolchain». If you already have a compiler and it’s associated tools installed on your computer, then you can just install Code::Blocks by itself and it will use the compiler that is already installed. It supports quite a few compilers: Visual Studio C++, GNU Compiler Collection (GCC), MinGW (Minimal GCC for Windows), etc. The setup file for just the Code::Blocks IDE by itself is: codeblocks-10.05-setup.exe. But if you don’t already have a compiler instaled on your computer, then you should install Code::Blocks with MinGW. The combined setup file for Code::Blocks and MinGW is: codeblocks-10.05mingw-setup.exe. This is the setup file that will work the best in most situations.
    Solutions
    1. Reinstall Code::Blocks using the setup program that includes MinGW: codeblocks-10.05mingw-setup.exe
    2. Solution b: Leave Code::Blocks installed, but install a compiler/toolchain to work with it. You can download the setup progam for MinGW here: MinGW download page. When you run the MinGW installer, be sure to select the C++ compiler and the MinGW Developer Toolkit in addition to the MinGW base files.
      Important: After installing MinGW, you need to set the toolset path in Code::Blocks to point to your MinGW installation. See the section below for instructions.
    1. Use the Code::Blocks auto-detect feature to find the compiler
      1. On the Code::Blocks menu, go to «Settings», next click on «Compiler and Debugger. «. This will open the «Compiler and debugger settings dialog».
      2. Under «Selected compiler» select the name of the compiler you are using. For most of you it will be «GNU GCC Compiler».
      3. Click on the tab that says «Toolchain executables», then click the button «Auto-detect». This should cause the compiler’s installation directory to be automatically inserted into the text box to the left of the button.
      1. Manually enter the path to the compiler’s installation directory
        1. On the Code::Blocks menu, go to «Settings», next click on «Compiler and Debugger. «. This will open the «Compiler and debugger settings dialog».
        2. Under «Selected compiler» select the name of the compiler you are using. For most of you it will be «GNU GCC Compiler».
        3. Click on the tab that says «Toolchain executables», then type in the path to the compiler’s installation directory in the text box labeld «Compiler’s installation directory».
        4. Be sure the names of all the executables are entered in the spaces listed under «Program Files».

        The screen shot below shows the default compiler and debugger settings if you installed Code::Blocks with the setup program that includes MinGW. These settings are the same on Windows XP, Vista, and Windows 7. (I’ve personally installed and tested Code::Blocks on 32 bit versions of each Windows OS and the 64 bit version of Windows 7.)

        1. You don’t have permission to write to the directory (folder) where your source code (.cpp file) is located.
          Solution
          Save your source file to your Documents folder, or some other location (like the desktop) that you know your user login has permission to write to.
        2. You created a .c source file instead of a .cpp source file.
          Solution
          Using the «Save as» option from the Code::Blocks file menu, save the source file as a .cpp file.

        by Brian Bird
        for CS133G Beginning C++ for Gaming
        Lane Community College

        Can’t find file executable in your configured search path for gnc gcc compiler

        My problem is that code::blocks error message tells me that it can’t find file executable in the search path for gnc gcc compiler. Although, I don’t know what that means. Also I typed out some code:

        #include using namespace std; int main(void)

        I can’t build it or run in code::blocks . What do I need to do? I went on line but I got some answers that are way over my head. I was able to use code::blocks once before I installed Visual studios express 2013 . Visual studios didn’t work right either. It kept asking me to repair or uninstall every time I tried to open it. So I deleted it along with code::blocks . Now that I re-installed code::blocks I still can’t get to work right. This problem with compilers is taking up all my time and I can’t practice learning programming because I can’t get any compiler to work right. I need some help, please.

        30.7k 6 6 gold badges 45 45 silver badges 52 52 bronze badges
        asked Apr 23, 2014 at 20:25
        1,972 8 8 gold badges 34 34 silver badges 44 44 bronze badges

        10 Answers 10

        I’m guessing you’ve installed Code::Blocks but not installed or set up GCC yet. I’m assuming you’re on Windows, based on your comments about Visual Studio; if you’re on a different platform, the steps for setting up GCC should be similar but not identical.

        First you’ll need to download GCC. There are lots and lots of different builds; personally, I use the 64-bit build of TDM-GCC. The setup for this might be a bit more complex than you’d care for, so you can go for the 32-bit version or just grab a preconfigured Code::Blocks/TDM-GCC setup here.

        Once your setup is done, go ahead and launch Code::Blocks. You don’t need to create a project or write any code yet; we’re just here to set stuff up or double-check your setup, depending on how you opted to install GCC.

        Go into the Settings menu, then select Global compiler settings in the sidebar, and select the Toolchain executables tab. Make sure the Compiler’s installation directory textbox matches the folder you installed GCC into. For me, this is C:\TDM-GCC-64 . Your path will vary, and this is completely fine; just make sure the path in the textbox is the same as the path you installed to. Pay careful attention to the warning note Code::Blocks shows: this folder must have a bin subfolder which will contain all the relevant GCC executables. If you look into the folder the textbox shows and there isn’t a bin subfolder there, you probably have the wrong installation folder specified.

        Now, in that same Toolchain executables screen, go through the individual Program Files boxes one by one and verify that the filenames shown in each are correct. You’ll want some variation of the following:

        • C compiler: gcc.exe (mine shows x86_64-w64-mingw32-gcc.exe )
        • C++ compiler: g++.exe (mine shows x86_64-w64-mingw32-g++.exe )
        • Linker for dynamic libs: g++.exe (mine shows x86_64-w64-mingw32-g++.exe )
        • Linker for static libs: gcc-ar.exe (mine shows x86_64-w64-mingw32-gcc-ar.exe )
        • Debugger: GDB/CDB debugger: Default
        • Resource compiler: windres.exe (mine shows windres.exe )
        • Make program: make.exe (mine shows mingw32-make.exe )

        Again, note that all of these files are in the bin subfolder of the folder shown in the Compiler installation folder box — if you can’t find these files, you probably have the wrong folder specified. It’s okay if the filenames aren’t a perfect match, though; different GCC builds might have differently prefixed filenames, as you can see from my setup.

        Once you’re done with all that, go ahead and click OK . You can restart Code::Blocks if you’d like, just to confirm the changes will stick even if there’s a crash (I’ve had occasional glitches where Code::Blocks will crash and forget any settings changed since the last launch).

        Now, you should be all set. Go ahead and try your little section of code again. You’ll want int main(void) to be int main() , but everything else looks good. Try building and running it and see what happens. It should run successfully.

        Code::Blocks не компелирует программы

        Я — полный нуб в программировании, но хочу освоить. Решил начать с языка Си. Относительно, недавно перешёл на Manjaro и установил Code::Blocks, но эта среда не компелирует. Появляется надпись:

        Project/Target: «c — Debug»: The compiler’s setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler. Probably the toolchain path within the compiler options is not setup correctly?! Do you have a compiler installed? Goto «Settings->Compiler…->Global compiler settings->GNU GCC Compiler->Toolchain executables» and fix the compiler’s setup.

        Tried to run compiler executable ‘/home/wind/CodeC/bin/gcc’, but failed!

        Skipping… Nothing to be done (all items are up-to-date).

        AnatoliyWind
        15.02.20 09:27:21 MSK

        Выучить английский (без него никак), поставить компилятор, т.к. IDE им не является.

        peregrine ★★★★★
        ( 15.02.20 09:31:56 MSK )

        Если по началу совсем никак используй гугл транслейт на худой конец

        Project / Target: «c - Debug»: настройка компилятора (компилятор GNU GCC) недопустима, поэтому Code :: Blocks не может найти / запустить компилятор. Возможно, путь к инструментальной цепочке в параметрах компилятора настроен неправильно ?! У вас установлен компилятор? Перейдите в «Настройки-> Компилятор… -> Глобальные настройки компилятора-> Компилятор GNU GCC-> Исполняемые файлы набора инструментов» и исправьте настройки компилятора. Попытался запустить исполняемый файл компилятора home / home / wind / CodeC / bin / gcc ’, но не смог! Пропуск . Ничего не поделаешь (все предметы актуальны). 

        LINUX-ORG-RU ★★★★★
        ( 15.02.20 09:42:15 MSK )
        Последнее исправление: LINUX-ORG-RU 15.02.20 09:43:40 MSK (всего исправлений: 1)

        Ответ на: комментарий от LINUX-ORG-RU 15.02.20 09:42:15 MSK

        Ты сделал сейчас педагогическую ошибку, тебе надо было не переводить текст, а дать ссылку на translate.google.com как таковой

        torvn77 ★★★★★
        ( 15.02.20 10:06:54 MSK )

        Если ты новичек, зачем используешь малопопулярные редакторы? Вместо Clion, VSCode. Рекомендую начать с последнего, там для C разработки всё есть. По крайней мере для начала �� Clion — это уже для серьёзных проектов

        menangen ★★★★★
        ( 15.02.20 10:22:23 MSK )
        Ответ на: комментарий от menangen 15.02.20 10:22:23 MSK

        Clion — это уже для серьёзных проектов

        В autotools ниумеет, в meson ниумеет, даже в автодополнение адекватно не может. Лучше выбрать KDevelop.

        Вообще ничего ниумеет. Толку то от популярности?

        stasolog
        ( 15.02.20 10:24:42 MSK )
        Последнее исправление: stasolog 15.02.20 10:25:30 MSK (всего исправлений: 1)

        Я считаю что IDE для начала это лишнее, выбери какой нибудь блокнот себе с подсветкой синтаксиса, и компилируй программы из консоли.

        echo '#include int main() < puts("hello world!"); >' > main.c gcc main.c ./a.out

        stasolog
        ( 15.02.20 10:30:01 MSK )
        Последнее исправление: stasolog 15.02.20 10:30:47 MSK (всего исправлений: 1)

        зачем ты в настройках указал, что компилятор у тебя лежит там?

        зачем ты вообще их менял, если он по по умолчанию прекрасно видит системный, установленный из пакетного менеджера

        grem ★★★★★
        ( 15.02.20 10:41:40 MSK )
        Последнее исправление: grem 15.02.20 10:45:08 MSK (всего исправлений: 2)

        Ответ на: комментарий от torvn77 15.02.20 10:06:54 MSK

        LINUX-ORG-RU ★★★★★
        ( 15.02.20 11:19:51 MSK )
        Ответ на: комментарий от LINUX-ORG-RU 15.02.20 11:19:51 MSK

        При этом обрати внимание на то как я дал эту ссылку.

        torvn77 ★★★★★
        ( 15.02.20 11:35:56 MSK )
        Ответ на: комментарий от stasolog 15.02.20 10:30:01 MSK

        Голосую за gedit . Редактор есть,подсветка есть, стили есть, панель с деревом файлов есть, свистопердулька (но удобная) для навигации по коду есть (панель правая с картинкой хз как занывается) , встроенный терминал для ручного ввода есть, он же сподвигнет применять систему сборки make тут идеально заходит (хотя он всегда идеально заходит). Даже базовое автодополнение есть из словаря открытого файла. Его хватит с головой на любой даже средний проект. А для обучения он прям на границе оверкила и вот вот прям самый раз. Там ещё модулей до жопы https://ibb.co/vP2wBFS . AnatoliyWind реби gedit учи базовый make и не будет проблем которые никак не связанны с тем что ты хочешь учить. Удачи

        LINUX-ORG-RU ★★★★★
        ( 15.02.20 11:36:57 MSK )
        Ответ на: комментарий от LINUX-ORG-RU 15.02.20 11:36:57 MSK

        Geany всем лучше.

        stasolog
        ( 15.02.20 11:39:24 MSK )
        Ответ на: комментарий от stasolog 15.02.20 11:39:24 MSK

        Да они по сути балансируют рядом, но geany так то да лучше. Я вот бросил geany сразу как только они документы и символы сдвоили на одной панели, по ублюдски стало как то. Хотя я его давно не смотрел, мож чё изменилось

        LINUX-ORG-RU ★★★★★
        ( 15.02.20 11:55:50 MSK )
        Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.

        Похожие темы

        • Форум Не компилит код в Code::blocks в gentoo (2018)
        • Форум Code::Blocks не могу разобраться (2014)
        • Форум Code::blocks (2006)
        • Форум Сборка застряла (2014)
        • Форум code::blocks code-completion (2010)
        • Форум New 17.0 profiles in the Gentoo repository (2017)
        • Форум Wine + COD4 (2018)
        • Форум [посоветуйте] Code::Blocks (2011)
        • Форум Code::Blocks + mingw32 (2016)
        • Новости Code::Blocks 17.12 (2018)

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *