falcong / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

undefined reference to pugi::xml... #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I unpacked the pugixml source into a directory, downloaded an example - 
"load_error_handling.cpp" and tried to compile it.

Instead of compiling correctly, it prints a pile of errors:
$ g++ -o test load_error_handling.cpp 
/tmp/ccvAY9L2.o: In function `check_xml(char const*)':
load_error_handling.cpp:(.text+0x15): undefined reference to 
`pugi::xml_document::xml_document()'
load_error_handling.cpp:(.text+0x39): undefined reference to 
`pugi::xml_document::load(char const*, unsigned int)'
load_error_handling.cpp:(.text+0x47): undefined reference to 
`pugi::xml_parse_result::operator bool() const'
load_error_handling.cpp:(.text+0x6c): undefined reference to 
`pugi::xml_node::child(char const*) const'
load_error_handling.cpp:(.text+0x89): undefined reference to 
`pugi::xml_node::attribute(char const*) const'
load_error_handling.cpp:(.text+0x97): undefined reference to 
`pugi::xml_attribute::value() const'
load_error_handling.cpp:(.text+0x10a): undefined reference to 
`pugi::xml_node::child(char const*) const'
load_error_handling.cpp:(.text+0x127): undefined reference to 
`pugi::xml_node::attribute(char const*) const'
load_error_handling.cpp:(.text+0x135): undefined reference to 
`pugi::xml_attribute::value() const'
load_error_handling.cpp:(.text+0x191): undefined reference to 
`pugi::xml_parse_result::description() const'
load_error_handling.cpp:(.text+0x22e): undefined reference to 
`pugi::xml_document::~xml_document()'
load_error_handling.cpp:(.text+0x248): undefined reference to 
`pugi::xml_document::~xml_document()'
collect2: ld returned 1 exit status

I am using pugixml 1.0 on Linux (Debian)

Original issue reported on code.google.com by LuciusM...@gmail.com on 13 Nov 2010 at 2:55

GoogleCodeExporter commented 9 years ago
pugixml is not a header-only library; you should add pugixml.cpp to 
compilation, i.e.:

g++ -o test load_error_handling.cpp pugixml.cpp

Original comment by arseny.k...@gmail.com on 13 Nov 2010 at 3:04

GoogleCodeExporter commented 9 years ago
Oh, I see, thank you.

Original comment by LuciusM...@gmail.com on 13 Nov 2010 at 3:15

GoogleCodeExporter commented 9 years ago
I'm closing this; if you have other problems, you can comment on this issue or 
create another one.

Original comment by arseny.k...@gmail.com on 13 Nov 2010 at 3:22