ola icon indicating copy to clipboard operation
ola copied to clipboard

Build fails: ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)

Open yurivict opened this issue 2 years ago • 5 comments

libtool: link: ( cd "plugins/usbdmx/.libs" && rm -f "libolausbdmxwidget.la" && ln -s "../libolausbdmxwidget.la" "libolausbdmxwidget.la" )
ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::operator<<(char const*)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::~LogMessage()
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::ZeroFieldsBase::~ZeroFieldsBase()
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::ArenaStringPtr::Set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, google::protobuf::Arena*)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::ArenaStringPtr::Set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&&, google::protobuf::Arena*)
>>> referenced by ola/.libs/libola.so
c++: error: linker command failed with exit code 1 (use -v to see invocation)

Adding -lprotobuf to LDFLAGS corrects this problem.

Version: 0.10.9 clang-15 FreeBSD 13.2

yurivict avatar Jun 30 '23 01:06 yurivict

I don't think we currently regularly test on BSD, so something has probably broken over time. I assume it builds without issue up to this point but gets to the end of building and fails to link? May you share the output of ./configure?

DaAwesomeP avatar Jun 30 '23 13:06 DaAwesomeP

I don't think we currently regularly test on BSD, so something has probably broken over time.

No, only very sporadically. Unless we can do it in GitHub Actions or someone wants to offer a machine to host a BuildBot that's unfortunately unlikely to change.

May you share the output of ./configure?

Can you also share config.log please?

peternewman avatar Jun 30 '23 15:06 peternewman

Output of configure:

===>  Configuring for ola-0.10.9
configure: loading site script /usr/ports/Templates/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... (cached) /bin/mkdir -p
checking for gawk... (cached) /usr/bin/awk
checking whether gmake sets $(MAKE)... yes
checking whether gmake supports nested variables... yes
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking for style of include used by gmake... GNU
checking dependency style of c++... gcc3
checking for gawk... (cached) /usr/bin/awk
checking for gcc... cc
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking dependency style of cc... gcc3
checking how to run the C preprocessor... cpp
checking whether ln -s works... yes
checking whether gmake sets $(MAKE)... (cached) yes
checking for -std=gnu++98 support... yes
checking for -std=gnu++11 support... yes
configure: checking for random gnu++98 compatibility
checking how to run the C++ preprocessor... c++ -E
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/egrep
checking for ANSI C header files... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking random usability... yes
checking random presence... yes
checking for random... yes
configure: checking for random gnu++11 compatibility
checking random usability... yes
checking random presence... yes
checking for random... yes
checking pkg-config is at least version 0.9.0... yes
checking for PROTOBUF1... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for sys/types.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/nameser.h... (cached) yes
checking for netdb.h... (cached) yes
checking for resolv.h... (cached) yes
checking for ANSI C header files... (cached) yes
checking for errno.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking bits/sockaddr.h usability... no
checking bits/sockaddr.h presence... no
checking for bits/sockaddr.h... no
checking for fcntl.h... (cached) yes
checking for float.h... (cached) yes
checking for limits.h... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for netinet/in.h... (cached) yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/file.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/time.h... (cached) yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking asm/termbits.h usability... no
checking asm/termbits.h presence... no
checking for asm/termbits.h... no
checking asm/termios.h usability... no
checking asm/termios.h presence... no
checking for asm/termios.h... no
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking for dlfcn.h... (cached) yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking linux/if_packet.h usability... no
checking linux/if_packet.h presence... no
checking for linux/if_packet.h... no
checking for math.h... (cached) yes
checking net/ethernet.h usability... yes
checking net/ethernet.h presence... yes
checking for net/ethernet.h... yes
checking stropts.h usability... no
checking stropts.h presence... no
checking for stropts.h... no
checking for sys/ioctl.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/uio.h... (cached) yes
checking sysexits.h usability... yes
checking sysexits.h presence... yes
checking for sysexits.h... yes
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking winerror.h usability... no
checking winerror.h presence... no
checking for winerror.h... no
checking random usability... yes
checking random presence... yes
checking for random... yes
checking for sys/sysctl.h... (cached) yes
checking for net/if.h... (cached) yes
checking for net/if_arp.h... yes
checking for net/route.h... yes
checking for net/if_ether.h... no
checking for netinet/if_ether.h... yes
checking for linux/netlink.h... no
checking for linux/rtnetlink.h... no
checking for stdbool.h that conforms to C99... (cached) yes
checking for _Bool... (cached) yes
checking for uid_t in sys/types.h... (cached) yes
checking for inline... inline
checking for int16_t... (cached) yes
checking for int32_t... (cached) yes
checking for int64_t... (cached) yes
checking for int8_t... (cached) yes
checking for pid_t... (cached) yes
checking for C/C++ restrict keyword... __restrict
checking for size_t... (cached) yes
checking for ssize_t... (cached) yes
checking for uint16_t... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... (cached) yes
checking for uint8_t... (cached) yes
checking the location of hash_map... <unordered_map>
checking for vfork.h... (cached) no
checking for fork... (cached) yes
checking for vfork... (cached) yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for working memcmp... yes
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking whether lstat correctly handles trailing slash... (cached) yes
checking whether stat accepts an empty string... no
checking whether closedir returns void... no
checking for vprintf... (cached) yes
checking for _doprnt... no
checking for bzero... (cached) yes
checking for gettimeofday... (cached) yes
checking for memmove... (cached) yes
checking for memset... (cached) yes
checking for mkdir... yes
checking for strdup... (cached) yes
checking for strrchr... (cached) yes
checking for if_nametoindex... yes
checking for inet_ntoa... (cached) yes
checking for inet_ntop... (cached) yes
checking for inet_aton... (cached) yes
checking for inet_pton... yes
checking for select... (cached) yes
checking for socket... yes
checking for strerror... (cached) yes
checking for getifaddrs... yes
checking for getloadavg... yes
checking for getpwnam_r... yes
checking for getpwuid_r... yes
checking for getgrnam_r... yes
checking for getgrgid_r... yes
checking for secure_getenv... no
checking for clock_gettime... (cached) yes
checking build system type... amd64-portbld-freebsd13.2
checking host system type... amd64-portbld-freebsd13.2
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... (cached) /usr/bin/fgrep
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... (cached) 524288
checking how to convert amd64-portbld-freebsd13.2 file names to amd64-portbld-freebsd13.2 format... func_convert_file_noop
checking how to convert amd64-portbld-freebsd13.2 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/local/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... (cached) yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... freebsd13.2 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... c++ -E
checking for ld used by c++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking for c++ option to produce PIC... -fPIC -DPIC
checking if c++ PIC flag -fPIC -DPIC works... yes
checking if c++ static flag -static works... yes
checking if c++ supports -c -o file.o... yes
checking if c++ supports -c -o file.o... (cached) yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... freebsd13.2 ld.so
checking how to hardcode library paths into programs... immediate
checking linux/version.h usability... no
checking linux/version.h presence... no
checking for linux/version.h... no
checking for Linux epoll(7) interface... no
checking for kqueue... yes
checking for -rdynamic support... no
checking for IPv6 support... no
checking for struct sockaddr.sa_len... yes
checking for struct sockaddr_dl.sdl_family... yes
checking for time_t... yes
checking for suseconds_t... yes
checking whether MSG_NOSIGNAL is declared... yes
checking whether SO_NOSIGPIPE is declared... yes
checking whether PF_ROUTE is declared... yes
checking whether NET_RT_DUMP is declared... yes
checking whether RLIMIT_RTPRIO is declared... no
checking whether RLIMIT_RTTIME is declared... no
checking whether SO_REUSEADDR is declared... yes
checking whether SO_REUSEPORT is declared... yes
checking for termios2... no
checking linux/spi/spidev.h usability... no
checking linux/spi/spidev.h presence... no
checking for linux/spi/spidev.h... no
checking for bison... bison
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
checking pkg-config is at least version 0.9.0... yes
checking for library containing dlopen... none required
checking for DMXdev in -ldmx4linux... no
checking dmx/dmxioctl.h usability... no
checking dmx/dmxioctl.h presence... no
checking for dmx/dmxioctl.h... no
checking for library containing clock_gettime... none required
checking for backtrace in -lexecinfo... yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking ncurses/curses.h usability... no
checking ncurses/curses.h presence... no
checking for ncurses/curses.h... no
checking for initscr in -lncurses... yes
checking for libncurses... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for pthread_np.h... yes
checking for 2-arg pthread_setname_np... yes
checking for resolv.h... (cached) yes
checking for res_init() in -lresolv... no
checking for res_init() in -resolv... no
checking for res_init() in -lc... yes
checking whether res_ninit is declared... yes
checking for base_uuid... yes
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
checking for uuid_generate in -luuid... yes
checking dns_sd.h usability... no
checking dns_sd.h presence... no
checking for dns_sd.h... no
checking for avahi... yes
checking SaleaeDeviceApi.h usability... no
checking SaleaeDeviceApi.h presence... no
checking for SaleaeDeviceApi.h... no
configure: WARNING: SaleaeDevice library is not usable.
checking for libmicrohttpd... yes
checking for MHD_create_response_from_buffer... yes
checking for libftdi0... no
checking for libftdi1... yes
checking for libusb... yes
checking for libusb_error_name... yes
checking for libusb_hotplug_api... no
checking for libusb_set_option... no
checking for asm/termios.h... (cached) no
checking for liblo... no
checking for serial port lock directory... /var/spool/lock
checking for flake8... yes
checking for libprotobuf... yes
checking for protoc... /usr/local/bin/protoc
checking protoc version... 3.21.12
checking google/protobuf/compiler/command_line_interface.h usability... yes
checking google/protobuf/compiler/command_line_interface.h presence... yes
checking for google/protobuf/compiler/command_line_interface.h... yes
checking google/protobuf/io/strtod.h usability... yes
checking google/protobuf/io/strtod.h presence... yes
checking for google/protobuf/io/strtod.h... yes
checking google/protobuf/stubs/logging.h usability... yes
checking google/protobuf/stubs/logging.h presence... yes
checking for google/protobuf/stubs/logging.h... yes
checking google/protobuf/stubs/stl_util.h usability... yes
checking google/protobuf/stubs/stl_util.h presence... yes
checking for google/protobuf/stubs/stl_util.h... yes
checking for doxygen... no
configure: WARNING: doxygen not found - will not generate any doxygen documentation
checking for perl... /usr/local/bin/perl
checking for flake8... (cached) yes
checking for cpplint... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating include/ola/base/Version.h
config.status: creating libola.pc
config.status: creating libolaserver.pc
config.status: creating libs/acn/libolaacn.pc
config.status: creating ola.spec
config.status: creating plugins/artnet/messages/libolaartnetconf.pc
config.status: creating plugins/e131/messages/libolae131conf.pc
config.status: creating plugins/usbpro/messages/libolausbproconf.pc
config.status: creating tools/e133/libolae133common.pc
config.status: creating tools/e133/libolae133controller.pc
config.status: creating Makefile
config.status: creating java/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
-------------------------------------------------------
OLA Version 0.10.9

Prefix: '/usr/local'
Compiler: 'c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -std=gnu++11 -D_THREAD_SAFE -pthread -isystem /usr/local/include'
Linker: '/usr/bin/ld  -fstack-protector-strong   -L/usr/local/lib -lexecinfo'
Python: 

Python API: no
Java API: no
Enable HTTP Server: yes
RDM Responder Tests: no
Ja Rule: no
Enabled Plugins: artnet dummy e131 espnet ftdidmx gpio karate kinet milinst opendmx openpixelcontrol pathport renard sandnet shownet stageprofi usbdmx usbpro
UUCP Lock Directory: /var/spool/lock

Now type 'make [<target>]'
  where the optional <target> is:
    all          - build everything
    check        - run the tests
    doxygen-doc  - generate the HTML documentation
    lint         - run the linters
-------------------------------------------------------

yurivict avatar Jun 30 '23 15:06 yurivict

config.log

yurivict avatar Jun 30 '23 15:06 yurivict

Thanks, so it did find those libs:

pkg_cv_libprotobuf_LIBS='-L/usr/local/lib -lprotobuf '
libprotobuf_LIBS='-L/usr/local/lib -lprotobuf '

But either didn't apply them, or apply them widely enough...

peternewman avatar Jun 30 '23 17:06 peternewman