include directories vs. lib directory concept question

前端 未结 3 960
迷失自我
迷失自我 2021-01-31 03:43

What is the difference between linking to include files versus linking to lib files?

I am fairly new to C/C++ and I\'m having a hard time figuring out the difference be

3条回答
  •  渐次进展
    2021-01-31 04:34

    to provide a simpler answer:

    .lib files are precompiled libraries. if you include a .lib, you also need to include the .h/hpp header files, so your compiler knows how to access the functions in the .lib.

    when you compile your program, all the functions used from the lib are only linked, they are note compiled again.

提交回复
热议问题