开发者

Can I link static library only with the .a file and without .xcodeproj one?

开发者 https://www.devze.com 2023-02-07 13:10 出处:网络
I\'ve created a cocoa static library and want to link it to my other app. Can I link it without including the .xcodeproj file ? (meaning - via the .a file only..)

I've created a cocoa static library and want to link it to my other app.

Can I link it without including the .xcodeproj file ? (meaning - via the .a file only..)

I don't the sources will be available to whoever links against it (only public 开发者_Python百科headers).

Thanks,

Guy.


We can link a static library without the .xcodeproj file.

Let's say we have libSDK.a file + public headers in our local "sdk/lib" and "sdk/include" folders (respectively) :

1. Drag the libSDK.a and headers files to our xcode project (preferrably in a dedicated group).
2. Double click on the target, select "Build" tab.
--- 2.1. Update the value in "Header Search Paths" setting to the "sdk/include" folder.
--- 2.2. Update the value in "Library Search Paths" setting to the "sdk/lib".
--- 2.3. Update the value in "Other Linker Flags" setting to "-ObjC -lSDK".
3. Build your project.

Now you're set to go.

0

精彩评论

暂无评论...
验证码 换一张
取 消