Xcode - how to include c library and header file to cocoa project?

前端 未结 3 1275
臣服心动
臣服心动 2020-12-28 20:12

How do I add c library to Xcode Cocoa project?

Or what is the best option, I don\'t want to copy them into Cocoa project directory.

I have a C project called

3条回答
  •  长情又很酷
    2020-12-28 21:14

    Here are the steps before adding a header file test.h in your project. Here is the files location root -> Library -> include -> test.h

    1. click on build settings

    2. Find User Header Search path. add your header file location here. add following value to Debug, Release and Any Architecture field. $(SRCROOT)/Library/include. Your project Root is the folder that contains your project, it conatins .xcodeproj file.

    After adding path you will be able to add header in like this

    # include "test.h"
    

提交回复
热议问题