C++ : Difference between linking library and adding include directories

后端 未结 3 909
夕颜
夕颜 2020-12-23 02:14

Pretty much title sums it up.

I\'m not sure the difference between the two if i\'d like to use a library.

Thanks!

3条回答
  •  抹茶落季
    2020-12-23 02:54

    The compiler needs to know the include directories, since it needs to include header (interface) files of libraries you want to use.

    The linker needs to know the library directories, since it needs to link your executable to the (precompiled) implementation of the library.

    See also What are the differences between a compiler and a linker?

提交回复
热议问题