S
S
sddvxd2019-01-02 03:14:11
C++ / C#
sddvxd, 2019-01-02 03:14:11

Where can I find libraries for GCC in linux?

Hello
Let's say I installed some library. Where to look for its location, so that later you can tell the compiler so that the program builds successfully?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Movchan, 2019-01-02
@sddvxd

Libraries are usually installed in /usr/lib/, /usr/local/lib and their subfolders. Usually these paths are already in LD_PATH, so it's enough to specify -l<libname>.
Libraries are also often installed along with the pkg-config configuration, so you can use it like this:

gcc -c file.c `pkg-config --cflags <libname>`
gcc file.o -o file `pkg-config --libs <libname>`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question