why we use different libararies in C
can some one PM me all Libararies ?

Dani AI

Generated

Short practical note expanding the replies by , , and others: a complete list of "all C libraries" is not useful or realistic. Libraries are chosen by the problem to solve (GUI, networking, crypto, compression, math, etc.). The productive approach is to learn how to discover, install, and link the libraries needed for a project, and how to troubleshoot when something goes wrong.

On Unix-like systems there are quick ways to see what the toolchain knows about and what packages are available. Two commonly used helpers are pkg-config (for libraries that ship .pc files) and the dynamic-link cache. Examples:

pkg-config --list-all
ldconfig -p | grep lib

See for details.

To actually use a library in a build, ensure the developer package (headers + library files) is installed, then give the compiler the include path and the linker the library path/name. Common patterns:

gcc -I/path/to/include -L/path/to/lib -lmylib main.c -o main
# or use pkg-config if supported:
gcc main.c $(pkg-config --cflags --libs libname) -o main

For multi-platform projects, prefer a build system that finds libraries for you (for example, CMake find_package). See CMake find_package.

Typical troubleshooting items: unresolved symbols (missing dev package or wrong link order), wrong architecture (32 vs 64 bit), missing runtime library (inspect with ldd ./program), and ABI/version mismatches. Tools such as nm/objdump help inspect symbols. For Windows consider dependency tools or package managers. Dependency managers like vcpkg or Conan help automate fetching and building libraries. Finally, check library licenses before bundling them with a project.

Recommended Answers

All 5 Replies

Different libraries provide differenet functionalities , check under installation directory of your compiler.

All libraries written in C?!.. Hundreds of million (or billions) lines of codes?!..
Probably you are multi-multi-millionaire: not all C libraries are freeware...

Or you prefer everything to be inside one super big library? In that case, your hello world program could become hundreds of megabyte in size because every single program has to link to that one and only library.

You are probably with the most common and known library of them all.. the Standard C Library.
It has good utilities you can use.. functions from headers <stdio.h>, <stdlib.h>, <string.h>, <time.h> will give you much power for your program.

Then you can either use libraries for OS-specific.. like the UNIX Library or smt like Win32 API for Windows.. however there are some platform-independent libraries written in C some of which are also free. Search google for them!

Or you prefer everything to be inside one super big library? In that case, your hello world program could become hundreds of megabyte in size because every single program has to link to that one and only library.

Even pathetic old 8-bitter toolchains had smarter libraries than that. Typically, it was bring in what's used (as opposed to a simple relocatable object file).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.