Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated instructions for embedding libMultiMarkdown in Xcode project #199

Open
nickasd opened this issue Feb 11, 2021 · 7 comments · May be fixed by #212
Open

Outdated instructions for embedding libMultiMarkdown in Xcode project #199

nickasd opened this issue Feb 11, 2021 · 7 comments · May be fixed by #212

Comments

@nickasd
Copy link
Contributor

nickasd commented Feb 11, 2021

After updating to version 6.6.0, I noticed that the Copy Files build phase doesn't exist anymore, and that #import <libMultiMarkdown/libMultiMarkdown.h> in Bridging-Header.h gives the error 'libMultiMarkdown/libMultiMarkdown.h' file not found. What has to be changed in order to make it work again?

@slsrepo
Copy link

slsrepo commented Feb 16, 2021

Hi @nickasd, Would love your input on issue #200 for Swift Package Manger support. It can potentially solve your issue :)

@fletcher
Copy link
Owner

I have not worked on Swift support in years, and every time Swift changes something breaks. @slsrepo has been more active with Swift.

@nickasd
Copy link
Contributor Author

nickasd commented Feb 18, 2021

Thanks, I will have a look at issue #200. (But this issue is about Objective-C, just in case there was a misunderstanding.)

@fletcher
Copy link
Owner

If there is an issue with Bridging-Header.h then this is a Swift issue, not Objective-C, since that file is only used with Swift projects, correct? Bridging-Header.h isn't even included in the current repo.

@nickasd
Copy link
Contributor Author

nickasd commented Feb 18, 2021

Yeah, sorry for the confusion. What I meant is that before upgrading it used to work: I was able to use the Objective-C symbols inside the Swift project. Now I get the errors listed above.

@slsrepo
Copy link

slsrepo commented Feb 18, 2021

The issue is related to Swift, Bridging-Header.h is a file automatically created by Xcode when you want to integrate a C library with Swift.

Since the issue is integrating with Swift, I suggested using the Swift Package instead :)

But without the package, I always had issues when trying to import the headers right from the library.

Sometimes it worked with #import <libMultiMarkdown/libMultiMarkdown.h>, sometimes with #import <libMultiMarkdown/include/libMultiMarkdown/libMultiMarkdown.h>, other times it didn't work no matter what. What I ended up doing (before creating the Swift package, which is what I have been using since) is copying the header files into my project and just using:

#import "libMultiMarkdown6.h"
#import "d_string.h"
#import "token.h"

But the downside of that is that you need to make sure the files in your project are up to date - an outdated header might cause all kind of weird issues that might be hard to debug.

I commented on issue #200 regarding the error you received. Once we get it working for you, that should be the best way to integrate with Swift :)

@nickasd
Copy link
Contributor Author

nickasd commented Jan 24, 2022

So does nobody know what to do with that Copy Files phase that is still mentioned in the readme?

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

Successfully merging a pull request may close this issue.

3 participants