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

Build error (Swift 3.0 Xcode 8.0 Beta 2) #3

Closed
iamjono opened this issue Jul 16, 2016 · 13 comments
Closed

Build error (Swift 3.0 Xcode 8.0 Beta 2) #3

iamjono opened this issue Jul 16, 2016 · 13 comments

Comments

@iamjono
Copy link

iamjono commented Jul 16, 2016

Added to Package.swift, then on swift build:

Cloning https://github.com/crossroadlabs/CDiscount.git
HEAD is now at 207cbc3 added modulemap
Resolved version: 0.1.0
Compile Swift Module 'Markdown' (3 sources)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "cdiscount.h"
        ^
/.../Packages/CDiscount-0.1.0/cdiscount.h:22:10: error: 'mkdio.h' file not found
#include <mkdio.h>
         ^
@dileping
Copy link
Member

@iamjono Hi, thanks for the feedback!

Have you done prerequisites?

brew install discount

@iamjono
Copy link
Author

iamjono commented Jul 17, 2016

Yep...

$ brew install discount
Warning: discount-2.2.0 already installed

@dileping
Copy link
Member

@iamjono: could you, please, check if it works with Carthage on your system?

@iamjono
Copy link
Author

iamjono commented Jul 17, 2016

I'm not using Carthage... I'm on Xcode 8.0 Beta 2, using SPM.
If I'm using SPM it should work without Carthage I would have presumed?

@dileping
Copy link
Member

@iamjono: Yes, it should. I'm just asking if you could try it with Carthage to find out if the issue is your system specific.

@iamjono
Copy link
Author

iamjono commented Jul 17, 2016

Yeah I did just try it with Carthage - no joy.

Note that there was already an entry in the linked frameworks and libraries for the Markdown.framework.

I should also note that it doesn't compile on the commandline using swift build, nor in Xcode.

@dileping
Copy link
Member

@iamjono: thanks a lot! Looks like something new. Will take a look at it asap.

@iamjono
Copy link
Author

iamjono commented Jul 17, 2016

That would be awesome, thanks!

@ypopovych
Copy link
Member

ypopovych commented Jul 18, 2016

Hi @iamjono ,
For the proper build, you have to add a header and library path to swift build command. So your command will be like this:
swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib

But seems as Markdown isn't ported to Swift 3.0 yet :(

@iamjono
Copy link
Author

iamjono commented Jul 18, 2016

Yep figured as much, on both counts.

I really wanted to use it for generating the HTML docs from markdown for https://github.com/PerfectlySoft/PerfectDocs :)

@dileping
Copy link
Member

@iamjono @ypopovych I will get my hands on this this week to make it both Swift 2/3 compatible

@dileping
Copy link
Member

@ypopovych @iamjono I've published a new version which supports Swift 3.0 (works with the newest Xcode). For now there is no possibility to build it without additional flags on Mac with swift build as there is no support for pkg-config in the underlying system library.

So, to build it on a Mac with swift build you still have to use these flags:

swift build -Xcc -I/usr/local/include -Xlinker -L/usr/local/lib

I will talk to the system library developers about the pkg-config issue. Let's see what we can do.

@dileping
Copy link
Member

@iamjono @ypopovych Some good news here, guys. I've made a PR to libmarkdown with pkg-config and it's merged already. Waiting for a new release.

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

No branches or pull requests

3 participants