Reputation: 31
i have the following problem, i need use expat.h library, i include the library normally:
#include <expat.h>
But when i try to create a object
XML_Parser Parser = XML_ParserCreate(NULL);
Eclipse keppler return undefined reference to XML_ParserCreate . I check the library and is included. I work with ubuntu 13.04 and g++ compiler.
any idea?
Upvotes: 2
Views: 3743
Reputation:
Probably you didn't link with the library. You should add this -lexpat
to the compiler`s command line. For example:
g++ main.cc -lexpat -o exe
A more advanced (and more easy to use, when you get up to speed) option would be to use pkg-config
as e.g. $(pkg-config --libs expat)
.
Upvotes: 3