简体   繁体   中英

How to link third party libraries properly in iOS

I'm new in iOS development, and met this library linking problem in last few days.

I was trying to use GMGridView in a project, but cannot make it working.

This project is shipped as static library, so I just drag the xcodeproj file in my project. Then I added libGMGridView.a in Link Binary With Libraries, GMGridView in Target Dependencies . I also added the path in Header Search Paths .

However, Xcode still report .h file not found error when I tried to import GMGridView.h.

Could anyone give me a hand on this? Thanks in advance!

Had the same issue!!! Made it work!!!! soooooooo:

  1. copy GMGridView folder from https://github.com/gmoledina/GMGridView to your project dir
  2. in xcode right click on any file group and choose add files
  3. find GMGridView folder in your folder dir and choose GMGridView.xcodeproj - (dont copy, create groups not folders, add targets)
  4. go to your project targets - search - HEADER_SEARCH_PATHS add- GMGridView/**
  5. select Building phases in settings - choose target dependencies and add GMGridView
  6. select Building phases in settings - link binary libraries and add libGMGridView.a

import should be:

#import "GMGridView.h"
#import <QuartzCore/QuartzCore.h>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM