sahe
sahe

Reputation: 1

GCC:- unable to find libpthread_nonshared.a file while linking libraries to create a so file on Linux

Hi I'm trying to compile a c project with gcc 10.2 in Ubuntu 20.04. But at the end it gives me error as below

/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
collect2: error: ld returned 1 exit status

Below are the libraries I'm trying to link while creating a so file -lpthread -ldl -lm -lstdc++ -lrt

When i looked into /usr/lib64 i could see only *.so files but no *.a files.

Do we need to install them separately?

Could someone help with this.

Upvotes: 0

Views: 9087

Answers (1)

Employed Russian
Employed Russian

Reputation: 213879

Do we need to install them separately?

You need to install glibc-devel (or similar) package.

Upvotes: 0

Related Questions