Th3Ya0vi / pugixml

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

Using pugixml in header-only mode #183

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi !

I followed your tutorial to use pugixml in this mode:

I added pugiconfig.hpp, pugixml.cpp and pugixml.hpp to my project.
In pugiconfig.hpp I uncommented :

#define PUGIXML_NO_XPATH

AND

#ifndef _DEBUG
#define PUGIXML_HEADER_ONLY
#include "pugixml.cpp"
#endif

In the main file of my project I added :

#include "pugiconfig.hpp"

The problem when I build the solution I've got the fatal error :

e:\c & m project\software library\music 
software\musicxml\xmlproject\xml\xml\pugixml.cpp(10252): fatal error C1010: 
unexpected end of file while looking for precompiled header. Did you forget to 
add '#include "stdafx.h"' to your source?

Could you help please ?

Many thanks

Michel

Original issue reported on code.google.com by fmichel....@gmail.com on 11 Oct 2012 at 2:30

GoogleCodeExporter commented 8 years ago
This is covered here:
http://pugixml.googlecode.com/svn/tags/latest/docs/manual/install.html#manual.in
stall.building.embed

Basically, since you want to compile pugixml.cpp in _DEBUG and are thus adding 
it to your project, you have to disable precompiled headers for pugixml.cpp. An 
alternative solution is to always use header-only mode and exclude pugixml.cpp 
from the project altogether.

Also note that you should include "pugixml.hpp" instead of "pugiconfig.hpp" - I 
think that the result is the same with header only builds, but in DEBUG you 
won't get any pugi symbols from pugiconfig.hpp with your setup.

Original comment by arseny.k...@gmail.com on 11 Oct 2012 at 4:30

GoogleCodeExporter commented 8 years ago

Original comment by arseny.k...@gmail.com on 12 Oct 2012 at 4:24