0

I have an issue recompiling my code on a newly installed raspi.

/usr/bin/g++ -c -Wall -g -O2 -fdebug-prefix-map=/build/log4cpp-E4MvbD/log4cpp-1.1.3=. -fstack-protector-strong -Wformat -Werror=format-security  -MD -MP -MF .dep/DataBlock.o.d DataBlock.cpp -o DataBlock.o
/usr/bin/g++ -c -Wall -g -O2 -fdebug-prefix-map=/build/log4cpp-E4MvbD/log4cpp-1.1.3=. -fstack-protector-strong -Wformat -Werror=format-security  -MD -MP -MF .dep/MemUsage.o.d MemUsage.cpp -o MemUsage.o
/usr/bin/g++ -Wall -g -O2 -fdebug-prefix-map=/build/log4cpp-E4MvbD/log4cpp-1.1.3=. -fstack-protector-strong -Wformat -Werror=format-security  -MD -MP -MF .dep/PiAwareStatus.d -lmosquitto -L/usr/lib/arm-linux-gnueabihf -llog4cpp -lpthread PiAwareStatus.o TCPReader.o MQTTWriter.o Mqtt.o DataBlock.o MemUsage.o -o PiAwareStatus

and I get a bunch of these errors - more or less every stating that log4ccp ?classes? are missing ...
/usr/bin/ld: PiAwareStatus.o: in function `signalHandler(int)':
/mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:143: undefined reference to `log4cpp::NDC::push(std::__cxx11::basic_string, std::allocator > const&)'
/usr/bin/ld: /mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:144: undefined reference to `log4cpp::Category::debug(char const*,
...)'
/usr/bin/ld: /mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:145: undefined reference to `log4cpp::Category::notice(char const*, ...)'
/usr/bin/ld: /mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:150: undefined reference to `log4cpp::Category::notice(char const*, ...)'
/usr/bin/ld: PiAwareStatus.o: in function `toggleLogLevel(int)':
/mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:162: undefined reference to `log4cpp::NDC::push(std::__cxx11::basic_string, std::allocator > const&)'

G++ Version

g++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110

log4cpp version is 1.1. from raspian repository

Has anybody some hints?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
dl2sba
  • 1
  • [See](https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc). Objects first, libraries next. – n. m. could be an AI Jan 29 '22 at 11:04
  • Downloaded the source from Sourceforge and build and installed it locally - same behaviour. – dl2sba Jan 30 '22 at 09:53
  • Have you read the link? – n. m. could be an AI Jan 30 '22 at 09:56
  • Compiles without issues on Linux XXXXX 5.10.52+ #1441 Tue Aug 3 18:08:18 BST 2021 armv6l GNU/Linux and these packages from repo: liblog4cpp5-dev/oldstable,now 1.1.3-1 armhf [installed] liblog4cpp5v5/oldstable,now 1.1.3-1 armhf [installed,automatic] – dl2sba Jan 30 '22 at 09:57

0 Answers0