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

No such module - libxml2 : Build fails #55

Closed
Kavisha-Dev opened this issue Feb 17, 2016 · 18 comments
Closed

No such module - libxml2 : Build fails #55

Kavisha-Dev opened this issue Feb 17, 2016 · 18 comments

Comments

@Kavisha-Dev
Copy link

Hi, i have followed the steps mentioned in the link :https://github.com/tid-kijyun/Kanna. But i keep getting the error : No such module - libxml2.

After using your files, my project looks like this -
screen shot 2016-02-17 at 6 32 04 pm
Also i have set the Swift Compiler - Search Paths > Import Paths as "$(SRCROOT)/Bhagavad Geetha Book/Modules".

Also, I am a little unclear with - "Step : 1 Add files to your project:" and "Step : 2 Copy folder to your project:" . Hopefully i have set your files correctly.

Kindly let me know if i have missed anything. Thanks in advance.

@tid-kijyun
Copy link
Owner

Hi @Kavisha-Dev

I've updated the README.md.

Step: 4. In the project settings add $(SRCROOT)/usr/include/libxml2 to the Build Settings > Search Paths > Header Search Paths field.

Thanks

@Kavisha-Dev
Copy link
Author

Thanks for the reply. I set this $(SRCROOT)/usr/include/libxml2 path. I cleaned the project. Still the same error - "No such module - libxml2" in file libxmlHTMLNode.swift. Anything more that i need to set?

@tid-kijyun
Copy link
Owner

Did you copy the Modules folder to the project folder?

Like this:
screen shot 2016-02-18 at 6 13 51 am

@Kavisha-Dev
Copy link
Author

Thanks for the reply,
I again did exactly as you mentioned in the above screenshot, and now i dont get No such module - libxml2 .

I try to use this code let html = "<html>...</html>"; let doc = HTML(html: html, encoding: NSUTF8StringEncoding);
and i get error - Use of unresolved identifer HTML.

(I have not used import Kanna, and it does not work with it too.)

@tid-kijyun
Copy link
Owner

Sorry, that's a typo.
Please change $(SRCROOT)/usr/include/libxml2 to $(SDKROOT)/usr/include/libxml2.

Thanks

@Kavisha-Dev
Copy link
Author

I followed the steps mentioned and now my project looks like this.
screen shot 2016-02-18 at 8 46 04 pm
screen shot 2016-02-18 at 8 48 37 pm
screen shot 2016-02-18 at 8 49 03 pm

I still get the same error Use of unresolved identifer HTML when i use let html = "<html>...</html>"; let doc = HTML(html: html, encoding: NSUTF8StringEncoding);.

Am i missing anything?

@tid-kijyun
Copy link
Owner

It appears to be no problem...

I've prepared a sample project. Please try to build and run this.
https://github.com/tid-kijyun/SampleKanna

@Kavisha-Dev
Copy link
Author

I think maybe it was a problem of setting paths :( . I have a space in my project name - Its like Bhagavad Geetha Book. I had to use "$(SRCROOT)/Bhagavad Geetha Book/Modules" i.e quotation marks.
And also i used the files that you attached in sample project you linked above.
i tried this multiple times with cleaning and it worked.

Thanks for the help.

@belladiallo
Copy link

Hello Tid,
I was usisng you old swift-HTML-Parser and now i want to migrate to xcode 8.2.
By following http://tid-kijyun.github.io/Kanna/ , I used cocoaPods

this is my podfile content:
screen shot 2016-12-22 at 10 50 11 am

In the terminale I did:

image

The folder of my xcode projet TutorialKanna:
screen shot 2016-12-22 at 10 51 31 am

More :
screen shot 2016-12-22 at 10 52 00 am

Question:
Am I missing something ?
How can I fixed it plesae ?
Thanks

image

@tid-kijyun
Copy link
Owner

Hi @belladiallo

It seems to be typo.

import Kanna  // Please capitalize the initial letters. 

@belladiallo
Copy link

belladiallo commented Dec 22, 2016

Hello @tid-kijyun
Thanks for your support :-)
I did it but
screen shot 2016-12-22 at 11 13 58 am

@tid-kijyun
Copy link
Owner

You have failed the pod install.
Cocoapods may not be installed correctly.

5eb483b2-c833-11e6-8f0b-7b2edc6cfbe8

FYI: xcode8 cocoapods abort trap:6

@belladiallo
Copy link

belladiallo commented Dec 22, 2016

Thanks so much.
I just update cocoapods (sudo gem update cocoapods) and every think works
Thanks so much

@belladiallo
Copy link

hello Tid,

in my real project I'm guetting this warning:

MBPdeBelaDIALLO:HQ-Mobilite2.1.1 Bella$ pod install
Analyzing dependencies
Downloading dependencies
Using Kanna (2.1.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] The Mobilite [Debug] target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in Pods/Target Support Files/Pods-Mobilite/Pods-Mobilite.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or
- Remove the build settings from the target.

[!] The Mobilite [Release] target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in Pods/Target Support Files/Pods-Mobilite/Pods-Mobilite.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or
- Remove the build settings from the target.

how can I fix it ?
Thanks

@tid-kijyun
Copy link
Owner

tid-kijyun commented Dec 23, 2016

Please ask stackoverflow for questions not related to this library.
I think that your problem will be solved if you google it.

keywords : ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

Thanks

@belladiallo
Copy link

thanks

@belladiallo
Copy link

belladiallo commented Dec 23, 2016

hello TID,

my html body content is

  •     <a href="156.htm" class="securite" data-new="false" data-datemodif="2016-06-07 10:38:54" id="156">Message</a><br/>
    
        <strong>securite</strong> [2016-06-07 10:38:54]<br/><br/>
    
    </li>
    
    
    
    <li>
    
        <a href="155.htm" class="securite" data-new="false" data-datemodif="2016-06-07 10:38:32" id="155">Safari</a><br/>
    
        <strong>securite</strong> [2016-06-07 10:38:32]<br/><br/>
    
    </li>
    

    How to get href value, id value, ...

    if let htmlDoc = HTML(html: contentDataString, encoding: .utf8) {
    print("\nisItNewData function\n htmlDoc: ---\n", htmlDoc.body?.text!,"\n----\n")
    for node in htmlDoc.xpath("//body//a") {
    let hrefValue = node.at_xpath("href")// how to get href (attribute) value???? example: 155.htm
    print("\nhrefValue = ", hrefValue, " node.text!: ", node.text!, "\n")
    }
    }

  • @belladiallo
    Copy link

    Thanks I got it 👍
    node["attributeName"]

    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

    No branches or pull requests

    3 participants