How to include C static libraries in CMAKE project on MAC OS X

后端 未结 2 1555
猫巷女王i
猫巷女王i 2021-01-16 10:19

I am trying to learn Core Foundation with C/C++. I use JetBrains CLion that uses CMAKE.

The problem is - I dunno how to include proper static libraries in C/C++ Make

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-16 11:12

    I'm not 100% sure if this is what you ment but you link C static libraries by giving -llibrary flag to your compiler where the name of the library file is liblibrary.a. If the library isn't in some default library location (idk what it is for mac) you can specify the path with -L flag.

提交回复
热议问题