Hi
I am trying to compile a standalone version of livestatus.o from 2.0.0.p17 release tar ball.
The target OS is RockyLinux 8 but since preferred dev OS is ubuntu, I tried this on ubuntu also.
Example same error message shows both in RL8 and ubuntu 20 test boxes.
I tried simple comment out the 1 7 duplicated references but run into issue.
if I run configure without --with-nagios4 then livestatus.o compiled ok but not able to load as nagioscore 4.4.6 broker module.
Steps
wget https://download.checkmk.com/checkmk/2.0.0p17/check-mk-raw-2.0.0p17.cre.tar.gz
make setup
tar xzf check-mk-raw-2.0.0p17.cre.tar.gz && cd check-mk-raw-2.0.0p17.cre
./configure --with-nagios4 && cd livestatus
make
CMK version:
check-mk-raw-2.0.0p17.cre
OS version:
me@ubuntu20t01:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION=“Ubuntu 20.04.3 LTS”
me@ubuntu20t01:~$
Error message:
me@ubuntu20t01:~/check-mk-raw-2.0.0p17.cre/livestatus$ make
Making all in src
make[1]: Entering directory '/home/me/check-mk-raw-2.0.0p17.cre/livestatus/src'
rm -f -r asio-asio-1-18-0
tar xzf /home/me/check-mk-raw-2.0.0p17.cre/omd/packages/asio/asio-asio-1-18-0.tar.gz
touch asio-asio-1-18-0
mkdir -p includes/asio
rsync -a --delete --exclude=Makefile.am --exclude=.gitignore asio-asio-1-18-0/asio/include/ includes/asio
patch -p0 < /home/me/check-mk-raw-2.0.0p17.cre/omd/packages/asio/asio.diff
patching file includes/asio/asio/basic_socket_streambuf.hpp
touch includes/asio
depbase=`echo unixcat.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
clang++-12 -std=c++17 -DHAVE_CONFIG_H -I. -I../.. -I.. -isystem includes/asio -DASIO_DISABLE_CONCEPTS -g -O2 -DNAG IOS4 -g -O2 -MT unixcat.o -MD -MP -MF $depbase.Tpo -c -o unixcat.o unixcat.cc &&\
mv -f $depbase.Tpo $depbase.Po
clang++-12 -std=c++17 -g -O2 -static-libstdc++ -o unixcat unixcat.o -lpthread
rm -f -r googletest-f3ef7e173f
tar xzf /home/me/check-mk-raw-2.0.0p17.cre/omd/packages/googletest/googletest-f3ef7e173f.tar.gz
touch googletest-f3ef7e173f/CMakeLists.txt
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is Clang 12.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-12
-- Check for working CXX compiler: /usr/bin/clang++-12 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /usr/bin/python3.9 (found version "3.9.5") found components: Interpreter
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/me/check-mk-raw-2.0.0p17.cre/livestatus/src/googletest-f3ef7e173f
touch googletest-f3ef7e173f/Makefile
make -C googletest-f3ef7e173f install > /dev/null
patch -p0 < /home/me/check-mk-raw-2.0.0p17.cre/omd/packages/googletest/googletest.diff
patching file includes/googletest/gtest/gtest-param-test.h
patching file includes/googletest/gtest/internal/gtest-internal.h
touch includes/googletest libs/libgmock.a libs/libgmock_main.a libs/libgtest.a libs/libgtest_main.a
Building rrdtool library...
mkdir -p $(dirname /home/me/check-mk-raw-2.0.0p17.cre/omd/build/package_build/rrdtool-1.7.1/src/build.log)
LANG=C make -j4 -C $(dirname $(dirname $(dirname $(dirname /home/me/check-mk-raw-2.0.0p17.cre/omd/build/package_build/rrdtool-1.7.1/src)))) rrdtool-build-library >/home/me/check-mk-raw-2.0.0p17.cre/omd/build/package_build/rrdtool-1.7.1/src/build.log 2>&1
touch rrdtool-1.7.1
clang++-12 -std=c++17 -DHAVE_CONFIG_H -I. -I../.. -I.. -isystem includes/asio -DASIO_DISABLE_CONCEPTS -Iincludes/googletest -I/home/me/check-mk-raw-2.0.0p17.cre/omd/build/package_build/rrdtool-1.7.1/src -g -O2 -DNAGIOS4 -g -O2 -MT test/neb-DummyNagios.o -MD -MP -MF test/.deps/neb-DummyNagios.Tpo -c -o test/neb-DummyNagios.o `test -f 'test/DummyNagios.cc' || echo './'`test/DummyNagios.cc
test/DummyNagios.cc:20:10: error: conflicting types for 'find_command'
command *find_command(char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:798:17: note: previous declaration is here
struct command *find_command(const char *);
^
test/DummyNagios.cc:21:10: error: conflicting types for 'find_contact'
contact *find_contact(char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:796:17: note: previous declaration is here
struct contact *find_contact(const char *);
^
test/DummyNagios.cc:22:15: error: conflicting types for 'find_contactgroup'
contactgroup *find_contactgroup(char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:797:22: note: previous declaration is here
struct contactgroup *find_contactgroup(const char *);
^
test/DummyNagios.cc:23:7: error: conflicting types for 'find_host'
host *find_host(char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:793:14: note: previous declaration is here
struct host *find_host(const char *);
^
test/DummyNagios.cc:24:12: error: conflicting types for 'find_hostgroup'
hostgroup *find_hostgroup(char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:794:19: note: previous declaration is here
struct hostgroup *find_hostgroup(const char *);
^
test/DummyNagios.cc:25:10: error: conflicting types for 'find_service'
service *find_service(char * /*unused*/, char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:799:17: note: previous declaration is here
struct service *find_service(const char *, const char *);
^
test/DummyNagios.cc:26:15: error: conflicting types for 'find_servicegroup'
servicegroup *find_servicegroup(char * /*unused*/) { return nullptr; }
^
../nagios4/objects.h:795:22: note: previous declaration is here
struct servicegroup *find_servicegroup(const char *);
^
test/DummyNagios.cc:65:5: error: functions that differ only in their return type cannot be overloaded
int schedule_new_event(int /*unused*/, int /*unused*/, time_t /*unused*/,
~~~ ^
../nagios4/nagios.h:491:14: note: previous declaration is here
timed_event *schedule_new_event(int, int, time_t, int, unsigned long, void *, int, void *, void *, int); /* schedules a new timed event */
~~~~~~~~~~~~~^
test/DummyNagios.cc:77:5: error: declaration of 'check_host_freshness' has a different language linkage
int check_host_freshness;
^
../nagios4/nagios.h:126:12: note: previous declaration is here
extern int check_host_freshness;
^
test/DummyNagios.cc:79:5: error: declaration of 'check_service_freshness' has a different language linkage
int check_service_freshness;
^
../nagios4/nagios.h:125:12: note: previous declaration is here
extern int check_service_freshness;
^
test/DummyNagios.cc:87:5: error: declaration of 'enable_environment_macros' has a different language linkage
int enable_environment_macros;
^
../nagios4/nagios.h:176:12: note: previous declaration is here
extern int enable_environment_macros;
^
test/DummyNagios.cc:95:15: error: declaration of 'event_broker_options' has a different language linkage
unsigned long event_broker_options;
^
../nagios4/nagios.h:168:22: note: previous declaration is here
extern unsigned long event_broker_options;
^
test/DummyNagios.cc:101:1: error: unknown type name 'circular_buffer'
circular_buffer external_command_buffer;
^
test/DummyNagios.cc:111:7: error: declaration of 'log_archive_path' has a different language linkage
char *log_archive_path;
^
../nagios4/nagios.h:77:14: note: previous declaration is here
extern char *log_archive_path;
^
test/DummyNagios.cc:113:7: error: declaration of 'log_file' has a different language linkage
char *log_file;
^
../nagios4/nagios.h:76:14: note: previous declaration is here
extern char *log_file;
^
test/DummyNagios.cc:115:5: error: declaration of 'log_initial_states' has a different language linkage
int log_initial_states;
^
../nagios4/nagios.h:93:12: note: previous declaration is here
extern int log_initial_states;
^
test/DummyNagios.cc:117:7: error: declaration of 'macro_user' has a different language linkage
char *macro_user[256];
^
../nagios4/nagios.h:56:14: note: previous declaration is here
extern char *macro_user[MAX_USER_MACROS];
^
17 errors generated.
make[1]: *** [Makefile:2450: test/neb-DummyNagios.o] Error 1
make[1]: Leaving directory '/home/me/check-mk-raw-2.0.0p17.cre/livestatus/src'
make: *** [Makefile:328: all-recursive] Error 1
me@ubuntu20t01:~/check-mk-raw-2.0.0p17.cre/livestatus$
Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)