Skip to content
This repository has been archived by the owner on Dec 7, 2017. It is now read-only.

How to import MagicKit in an iOS project? #5

Open
mdestagnol opened this issue Nov 23, 2012 · 3 comments
Open

How to import MagicKit in an iOS project? #5

mdestagnol opened this issue Nov 23, 2012 · 3 comments

Comments

@mdestagnol
Copy link

I tried for hours now but can't figure out. Do you think you could add an Installation section in the README? Many thx

@jessecurry
Copy link

Might be a little late for to original question, but there are a couple ways.

One would be to build the static library, then import the static library, the MagicKit headers, and the magic.mgc file.

Another would be to add the MagicKit project to your iOS project, make sure that the MagicKit-iOS is a target dependency, link against libMagicKit-iOS, and import a copy of magic.mgc into your project.

@ronakvora
Copy link

mdestagnol, you need to add -D_FORTIFY_SOURCE=0 to Other C Flags in Build Settings. This will let you compile!

@jessecurry where do we import the magic.mgc file? Everything works but when I call a MagicKit function, it says it can't find the magic database. I tried putting it under Resources but no luck.

@ronakvora
Copy link

Nevermind, I got it. For future readers:

http://stackoverflow.com/questions/6263289/accesing-a-file-using-nsbundle-mainbundle-pathforresource-oftypeindirectory

Add it to the Copy Bundle Resources in Build Phases :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants