link static lib in eclipse cdt

后端 未结 3 1773
野性不改
野性不改 2020-12-09 09:17

I am sorry! I have googled this a lot and cannot find an answer! It\'s dumb I know.

I cannot link in static libraries(*.a) in eclipse cdt. I listed them all in Pr

3条回答
  •  [愿得一人]
    2020-12-09 09:54

    Static libraries or archives are just a collection of object files.

    Add the archive as Other Objects under C/C++ Build -> Settings -> C++ Linker -> Miscellaneous:

    enter image description here

    Some folks cry bloody murder over specifying a full pathname. I find it works in practice (unlike theory at times), and its no worse than breaking the path and filename, and then specifying them with -L and -l. And did I mention it actually works in practice...

提交回复
热议问题