Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log4cpp: Linux can't find the lib files

Tags:

c++

linux

log4cpp

I download the log4cpp in my Linux and I use the commands below to install:

./configure
make
make check
make install

After that, I can find the lib files below in the path "/usr/local/lib":

liblog4cpp.a
liblog4cpp.la
liblog4cpp.so
liblog4cpp.so.4
liblog4cpp.so.4.0.0

Then I tried to use the log4cpp in my cpp project, which is complied by gcc11.

But I got the error message:

Undefined reference to "log4cpp::Category::shutdown()"

I think it can't find the lib files. So I added liblog4cpp.so manually.

Now I got this error:

undefined reference to "pthread_key_create"

What should I do?

like image 927
Yves Avatar asked May 02 '26 15:05

Yves


1 Answers

log4cpp is C++ lib, I recommend configure and build it using the same C++ compiler

like image 191
yuri Avatar answered May 04 '26 03:05

yuri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!