How to use pugixml in Dev-C++

1.8k views Asked by At

I have never added a library to Dev-C++. I read the guide here.

So I added two lines of code to my cpp file:

#include "pugixml.hpp"
#include "pugiconfig.hpp"

But I get errors like this:

[Linker error] C:\Users\MATRIX~1\AppData\Local\Temp\ccYfRAuS.o:2.visualizza tutto.cpp:(.text+0xbc): undefined reference to `pugi::xml_document::xml_document()'

Can someone tell me how to do this in Dev-C++? I need to create a simple program that reads the XML that I created.

3

There are 3 answers

4
austin On

You need to add the pugixml libraries. In Dev-C++ go to your project's linker settings and find the pugixml .lib files and add them.

0
HurricaneOnTheMoon On

Add the existing files' path to the include directory, then add the existing files to your project.

Then you will be able to reference them in #include and also in written code.

0
User8 On

You don't need .lib file, you need to add pugixml.cpp to compilation. In Dev-C++ menu choose "Project" - > "Add To Project..." and choose pugixml.cpp.