0

我在新安装的 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.od 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.od 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

我得到了一堆这样的错误 - 或多或少地每一个说明 log4ccp ?类?缺失 ...
/usr/bin/ld:PiAwareStatus.o:在函数“signalHandler(int)”中:
/mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:143: 未定义对 `log4cpp::NDC::push(std::__cxx11::basic_string, std::allocator > const&)' 的引用
/usr/bin/ld: /mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:144: 未定义引用`log4cpp::Category::debug(char const*,
...)'
/usr/bin/ld: /mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:145: 未定义的对 `log4cpp::Category::notice(char const*, ...)' 的引用
/usr/bin/ld: /mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:150: 未定义的对 `log4cpp::Category::notice(char const*, ...)' 的引用
/usr/bin/ld: PiAwareStatus.o: 在函数`toggleLogLevel(int)'中:
/mnt/source/raspberry/PiAwareStatus/PiAwareStatus.cpp:162: 未定义对 `log4cpp::NDC::push(std::__cxx11::basic_string, std::allocator > const&)' 的引用

G++版本

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

log4cpp 版本是 1.1。来自 raspian 存储库

有人有一些提示吗?

4

0 回答 0