Compiler can't find libxml/parser.h

后端 未结 3 1123
谎友^
谎友^ 2020-12-10 13:23

I am on Debian 8 (Jessie), 64 Bit. I installed libxml2-dev, which now sits in /usr/include/libxml2/libxml.

But when I do (just like l

相关标签:
3条回答
  • 2020-12-10 13:27

    Try to compile with explicite inclusion where the parser.h file is, i.e. smth like this

    g++ -I/usr/include/libxml2/


    Following environment variables can also be used for lookup of header files

    CPATH
    C_INCLUDE_PATH
    CPLUS_INCLUDE_PATH
    OBJC_INCLUDE_PATH
    

    Find more information here

    0 讨论(0)
  • 2020-12-10 13:32

    You should use pkg-config to pass parameters to compiler. Like this

    g++ `pkg-config --cflags libxml-2.0` example.c -o example.o
    

    and to linker:

    g++ `pkg-config --libs libxml-2.0` example.o -o example
    
    0 讨论(0)
  • 2020-12-10 13:39

    if you installed it: sudo apt-get install libxml2-dev libxml2-doc go into /usr/include/libxml2 and copy or move all content from that folder on a level below: cp -R libxml/ ../ After this for me it works.

    0 讨论(0)
提交回复
热议问题