c++ - Linking errors for pugixml in wchar mode -


when i'm trying build binary using pugi in wchar mode, load of linker undefined reference errors hinting @ lack of wchar_t versions of functions in library.

i'm using ubuntu 16.04 , libpugixml-dev got apt-get.

here's example code refuses build:

#include <pugixml.hpp>  int main(int argc, char *argv[]) {     pugi::xml_node n;     n.set_name(l"");      return 0; } 

i build with

g++ -o pugi_test main.cpp -std=c++11 -dpugixml_wchar_mode -lpugixml 

and get

undefined reference `pugi::xml_node::set_name(wchar_t const*)' 

i tried putting #define pugixml_wchar_mode in main.cpp above #include, , uncommenting same #define in pugiconfig.hpp.

if remove traces of wchar (l"""" , remove -dpugixml_wchar_mode), build goes without hitch.

am supposed rebuild library if want use wchar mode? couldn't find of relevance in the manual.

am supposed rebuild library if want use wchar mode?

yes. make little sense have such pugixml_wchar_mode macro unless controlled compilation of library (in opinion). must (un-)defined both when compiling library , user of library.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -