Author Topic: no compiler program set  (Read 8083 times)

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
no compiler program set
« on: January 03, 2019, 01:19:53 am »
I use CB 16.01 on Linux mint 17.
I opened a new project for a console application using gnu gcc.
Attempting to compile the generated main.c I get the message:
-------------- Build file: Debug in Simulator (compiler: GNU GCC Compiler)---------------

Skipping file (no compiler program set): main.c
Done.

How to fix this issue?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: no compiler program set
« Reply #1 on: January 03, 2019, 11:24:47 am »
Install an compiler

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #2 on: January 03, 2019, 02:04:25 pm »
Install an compiler

Very wise advice…

But how to do this in CB? (cpp is installed and running on my system.)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: no compiler program set
« Reply #3 on: January 03, 2019, 02:16:23 pm »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: no compiler program set
« Reply #4 on: January 03, 2019, 02:29:24 pm »
Very wise advice…

Well you did not give any information if you have installed any compiler, or if yes, what compiler do you have installed. So my first advise is to install a compiler...
If you have installed a compiler then say so and also give version and installation method...

remember codeblocks IS NOT A COMPILER, codeblocks is an IDE

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #5 on: January 03, 2019, 02:41:51 pm »
What is cpp?

Have you read any of these: http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler ?

Sorry,  gcc - as I write in my first posting: I opened a new project for a console application using gnu gcc.

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #6 on: January 03, 2019, 02:43:54 pm »
Very wise advice…

Well you did not give any information if you have installed any compiler, or if yes, what compiler do you have installed. So my first advise is to install a compiler...
If you have installed a compiler then say so and also give version and installation method...

remember codeblocks IS NOT A COMPILER, codeblocks is an IDE

Read my initial posting…

$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #7 on: January 03, 2019, 06:35:04 pm »
No idea, how ti fix this issue?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: no compiler program set
« Reply #8 on: January 03, 2019, 06:48:28 pm »
http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler#Compiler-neutral_setup_steps

The above is a hyperlink! Please try to follow the directions linked.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #9 on: January 03, 2019, 07:25:35 pm »
Thanks a lot, Tim.

The issue was, that CB doesn't autotetect gcc on my linux mint correctly.
Using which to find aout the path to gcc:
    $ which gcc
    /usr/bin/gcc
so the path to gcc is usr/bin/ - as expected - but CB autodetection says /usr, which can't work.

Seems to be a bug in CB for linux.

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #10 on: January 03, 2019, 07:56:31 pm »
My reply was partially wrong, sorry.

There is a notice on the toolchain executables tab:
    NOTE: All programs must exist either in the "bin" sub-directory of this path, or in any of the "Additional paths".
So /usr should work - but it doesn't. I still get the error message:
    Skipping file (no compiler program set): main.c

Until now I only used avr-gcc with CB using the avr-plugin. That works very well w/o any additional setup.

How to get CB running gcc on a linux system?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: no compiler program set
« Reply #11 on: January 03, 2019, 08:10:59 pm »
Quote
How to get CB running gcc on a linux system?
Normally it runs out of the box... You seem to have something strange on your system...

Can you make a screenshot of the compiler settings for gcc (Settings->Compiler->Global compiler settings->Select: "GNU GCC compiler" from the dropdown->Toolchain executable)?

If not: have you set the compiler names in the Settings->Compiler->Global compiler settings->Select: "GNU GCC compiler" from the dropdown->Toolchain executable->C compiler ecc..?

Can you try to generate a new project? After you have started codeblocks the first time?

Quote
So /usr should work - but it doesn't. I still get the error message:
Have you tried the following paths:
Quote
/usr/bin
/usr
?
Please restart codeblocks after changing the settings and try to create a new project, do not use the old project.

Very wise advice…
Well you did not give any information if you have installed any compiler, or if yes, what compiler do you have installed. So my first advise is to install a compiler...
If you have installed a compiler then say so and also give version and installation method...
remember codeblocks IS NOT A COMPILER, codeblocks is an IDE
Read my initial posting…
I did not see any answer to my questions in your first post...

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #12 on: January 03, 2019, 08:54:14 pm »
Normally it runs out of the box... You seem to have something strange on your system...
That's what I read and hoped.

Quote
Can you make a screenshot of the compiler settings for gcc (Settings->Compiler->Global compiler settings->Select: "GNU GCC compiler" from the dropdown->Toolchain executable)?

See the attachments.

Quote
Can you try to generate a new project? After you have started codeblocks the first time?

CB is running for years now on my system. (Usually w/ avr-gcc.) The gcc project is brand new.

Quote
Please restart codeblocks after changing the settings and try to create a new project, do not use the old project.

I restarted after autodetect and a few moments ago started once more - no change. CB doesn't find gcc.
Few minutes ago, I generated a new test project and started gcc on the generated main.c - same effect, same error diagnostic.

Quote
Well you did not give any information if you have installed any compiler, or if yes, what compiler do you have installed. So my first advise is to install a compiler...
See my posting from 02:43:54 pm. On most linux systems and specially on debian like systems, gcc is preinstalled. Linux Mint is such a system. And for sure the compiler works, I frequently use it to compile new packages from source downloads.

Quote
If you have installed a compiler then say so and also give version and installation method...
See my posting from 02:43:54 pm - there is the complete version info of the compiler.

Offline hanshuckebein

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: no compiler program set
« Reply #13 on: January 03, 2019, 09:10:28 pm »
Even directly selecting of gcc under toolchain executables dosn't help. Something is going badly wrong…

Is there a possibility to see the spawned command for gcc, issued by cb?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: no compiler program set
« Reply #14 on: January 03, 2019, 10:40:31 pm »
Quote
Is there a possibility to see the spawned command for gcc, issued by cb?
You can look in the "build log" tab of the message window. But i do not think that there is something logged. This message tells us that your compiler command is empty and the build process won't start with an empty command...

Can you try to rename your config file to something else and restart codeblocks? It should be located in your home folder in the sub folder .codeblocks and named default.conf (i do not remember where it is located on linux, it can also be in .config folder...) This will reset codeblocks to defaults.

If this is working can you zip the file and upload it?

avr gcc is working with exactly this installation?
« Last Edit: January 03, 2019, 10:43:30 pm by BlueHazzard »