ahodesuka / ahoviewer

A GTK image viewer, manga reader, and booru browser
MIT License
483 stars 30 forks source link

libxml make issue #77

Closed wickedwzrd closed 5 years ago

wickedwzrd commented 5 years ago

I'm running osx 10.14.2 and I just pulled the most recent version since I was running 1.50. I tried to compile but was given this error:


/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
  CXX      booru/ahoviewer-browser.o
In file included from booru/browser.cc:4:
In file included from booru/browser.h:6:
In file included from booru/page.h:9:
In file included from booru/imagelist.h:5:
booru/xml.h:4:10: fatal error: 'libxml/parser.h' file not found
#include <libxml/parser.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [booru/ahoviewer-browser.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1```
ahodesuka commented 5 years ago

Seems like something is missing from your libxml. Nothing has changed since 1.5.0 that should be causing this error. On gentoo my libxml headers are in a directory like this:

ls /usr/include/libxml2/libxml/
c14n.h              list.h              tree.h              xmlregexp.h       
catalog.h           nanoftp.h           uri.h               xmlsave.h         
chvalid.h           nanohttp.h          valid.h             xmlschemas.h      
debugXML.h          parser.h            xinclude.h          xmlschemastypes.h 
dict.h              parserInternals.h   xlink.h             xmlstring.h       
DOCBparser.h        pattern.h           xmlautomata.h       xmlunicode.h      
encoding.h          relaxng.h           xmlerror.h          xmlversion.h      
entities.h          SAX2.h              xmlexports.h        xmlwriter.h       
globals.h           SAX.h               xmlIO.h             xpath.h           
hash.h              schemasInternals.h  xmlmemory.h         xpathInternals.h  
HTMLparser.h        schematron.h        xmlmodule.h         xpointer.h        
HTMLtree.h          threads.h           xmlreader.h

/usr/include/libxml2 gets included by pkg-config.

Try running pkg-config --cflags libxml-2.0 and posting the result as well as the ls output of the former's output.

wickedwzrd commented 5 years ago

ls results:

ls /usr/local/Cellar/libxml2/2.9.8_1/include/libxml2/libxml/
DOCBparser.h       encoding.h         relaxng.h          xmlautomata.h      xmlstring.h
HTMLparser.h       entities.h         schemasInternals.h xmlerror.h         xmlunicode.h
HTMLtree.h         globals.h          schematron.h       xmlexports.h       xmlversion.h
SAX.h              hash.h             threads.h          xmlmemory.h        xmlwriter.h
SAX2.h             list.h             tree.h             xmlmodule.h        xpath.h
c14n.h             nanoftp.h          uri.h              xmlreader.h        xpathInternals.h
catalog.h          nanohttp.h         valid.h            xmlregexp.h        xpointer.h
chvalid.h          parser.h           xinclude.h         xmlsave.h
debugXML.h         parserInternals.h  xlink.h            xmlschemas.h
dict.h             pattern.h          xmlIO.h            xmlschemastypes.h

pkg-config --cflags libxml-2.0 results:

pkg-config --cflags libxml-2.0
-I/usr/include/libxml2

I don't have a /usr/include/ folder but I do also have the latest xcode-select --install tools installed, which includes libxml2.

ahodesuka commented 5 years ago

Seems like your pkg-config file for libxml2 is broken if it's pointing towards a non-existent directory. The location of my libxml2 pkg-config file is /usr/share/pkgconfig/xml2po.pc, yours may differ, but you should probably edit the first line of it prefix=/usr to prefix=/usr/local/Cellar/libxml2/2.9.8_1

wickedwzrd commented 5 years ago

I changed the directory to where the pkg-config points to and went through the install steps again and it worked perfectly. Thanks for your help