What is the relationship between header files and library files in C ++?

Why do we need to add compilation of both include and lib?

Why doesn't libs wrap everything in it?

+3
source share
3 answers

The header file (usually) contains only declarations for classes and functions. Actual implementations are built from CPP files. You can then associate these implementations with header declarations that are available only.

+1
source

Header files define interfaces; libraries provide implementation.

, , , , , .

, . , , .

+5

, , #include < mysql.h > ?

Unfortunately, I believe that the best solution is to either learn more about C ++ or learn more about Google before publishing absolutely everything on this site.

-1
source

Source: https://habr.com/ru/post/1738499/


All Articles