c++ - Null pointer while trying to read xml with boost -


i stumbled upon interesting problem. have managed reduce problem following code:

boost::property_tree::ptree properties; boost::property_tree::read_xml("additional dependencies\\properties.xml", properties); 

xml:

<properties>    <picturegenerator>     <miniatureheight>4</miniatureheight>     <miniaturewidth>4</miniaturewidth>      <imageheight>8</imageheight>     <imagewidth>8</imagewidth>      <imagepath>additional dependencies\</imagepath>     <miniatures>       <image>0.bmp</image>       <image>1.bmp</image>       <!--<image>2.bmp</image>       <image>3.bmp</image>       <image>4.bmp</image>-->     </miniatures>    </picturegenerator> </properties> 

when build project in release mode, runs perfectly. in debug mode following error:

unhandled exception @ 0x779e8e19 in my_project.exe: 0xc0000005: access violation writing location 0x00000014. 

i using vs2010. upon further inspection error thrown in read_xml_internal function while trying create vector basic_istream. @ first thought gave wrong path, works in release mode.

i have found source of problem. have reproduced same error istream, , turned out had wrong property page set debug.

the problem property:

c/c++ -> code generation -> runtime libary multi-threaded 

i have changed multi-threaded debug dll , works perfectly.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -