Page 1 of 1

Problem compiling nagios core on rocky linux 9 (i.e. gcc 11)

Posted: Tue Jan 21, 2025 7:36 am
by MortenSickel
I am trying to compile nagios 4.5.9 on a rocky linux9 box.

I have cloned the nagioscore git repository and checked out the nagios-4.5.9 release

Then I do ./configure that runs without any problems, but make all stops on

Code: Select all

make[2]: Entering directory '/staff/morten/nagios/nagioscore/lib'
gcc -Wall -I.. -I. -I../lib -I../include  -I../include -I..  -std=c99  -DHAVE_CONFIG_H -DNSCORE -DHAVE_CONFIG_H -c worke
r.c -o worker.o
In file included from ../include/config.h:316,
                 from worker.c:11:
/usr/include/wchar.h:476:27: error: unknown type name ‘locale_t’
  476 |                           locale_t __loc) __THROW;
      |                           ^~~~~~~~
/usr/include/wchar.h:480:49: error: unknown type name ‘locale_t’
  480 |                                     int __base, locale_t __loc) __THROW;
      |                                                 ^~~~~~~~
/usr/include/wchar.h:485:45: error: unknown type name ‘locale_t’
  485 |                                 int __base, locale_t __loc) __THROW;
      |                                             ^~~~~~~~
/usr/include/wchar.h:490:55: error: unknown type name ‘locale_t’
  490 |                                           int __base, locale_t __loc)
      |                                                       ^~~~~~~~
/usr/include/wchar.h:494:56: error: unknown type name ‘locale_t’
  494 |                         wchar_t **__restrict __endptr, locale_t __loc)
      |                                                        ^~~~~~~~
/usr/include/wchar.h:498:55: error: unknown type name ‘locale_t’
  498 |                        wchar_t **__restrict __endptr, locale_t __loc)
      |                                                       ^~~~~~~~
/usr/include/wchar.h:503:31: error: unknown type name ‘locale_t’
  503 |                               locale_t __loc) __THROW;
      |                               ^~~~~~~~
/usr/include/wchar.h:514:29: error: unknown type name ‘locale_t’
  514 |                             locale_t __loc) __THROW;
      |                             ^~~~~~~~
/usr/include/wchar.h:520:29: error: unknown type name ‘locale_t’
  520 |                             locale_t __loc) __THROW;
      |                             ^~~~~~~~
/usr/include/wchar.h:526:31: error: unknown type name ‘locale_t’
  526 |                               locale_t __loc) __THROW;
      |                               ^~~~~~~~
/usr/include/wchar.h:532:31: error: unknown type name ‘locale_t’
  532 |                               locale_t __loc) __THROW;
      |                               ^~~~~~~~
/usr/include/wchar.h:538:31: error: unknown type name ‘locale_t’
  538 |                               locale_t __loc) __THROW;
      |                               ^~~~~~~~
/usr/include/wchar.h:862:27: error: unknown type name ‘locale_t’
  862 |                           locale_t __loc) __THROW;
      |                           ^~~~~~~~
worker.c: In function ‘exit_worker’:
worker.c:42:26: error: storage size of ‘sig_action’ isn’t known
   42 |         struct sigaction sig_action;
      |                          ^~~~~~~~~~
In the end it spits out a few more warnings and unknown storage size errors. It compiles fine on another server with centos7, i.e. gcc 4.8.5 I guess this may have to do with altered header files in rocky9, or maybe there is something I have not installed?

Re: Problem compiling nagios core on rocky linux 9 (i.e. gcc 11)

Posted: Tue Jan 21, 2025 11:02 am
by danderson
Thanks for reaching out,

I was able to manually trigger your issue by running configure like so CFLAGS=-std=c99 ./configure, are you doing something similar? Otherwise I can look into why this CFLAG is getting added.

Re: Problem compiling nagios core on rocky linux 9 (i.e. gcc 11)

Posted: Tue Jan 21, 2025 3:38 pm
by MortenSickel
Well spotted and the problem was entirely my fault.

I had some problems compiling it earlier on and set CFLAGS to try to fix it. Then I forgot the CFLAG setting.

unset CFLAG solved my problem

Thanks!

Re: Problem compiling nagios core on rocky linux 9 (i.e. gcc 11)

Posted: Wed Jan 22, 2025 11:29 am
by danderson
Nice! I'm glad that resolved your issue!