Compiler can't find libxml/parser.h

后端 未结 3 1131
谎友^
谎友^ 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: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
    

提交回复
热议问题