'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.



Solution 1:[1]

Do we need to install them separately?

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Employed Russian