0

I am trying to parse and read xml files in c++ program using libxml2 library. I have written a code with c++ and I couldn't run successfully the code. I have an error:

main.cpp:(.text+0x79): undefined reference to `print_element_names(_xmlNode*)'
collect2: error: ld returned 1 exit status
make[2]: *** [svgreader] Error 1
make[1]: *** [CMakeFiles/svgreader.dir/all] Error 2
make: *** [all] Error 2

1 Answers1

2

As πάντα ῥεῖ directed in the comment to your question, it is the same problem. In the linked article, number 9 emphasized in bold, applies to your case. To be specific, I can see there is a function prototype, static void print_element_names(xmlNode * a_node); but where is it defined? Is this defined in other source file? Or is it a library function you forgot to link with? This is what the error message is telling you.

Keugyeol
  • 2,355
  • 1
  • 28
  • 36