Re: Compiler Errors



2012-12-01 07:43, Santhosh Edukulla skrev:
Hi Team,

Two questions below:

1/   Iam getting one more crash where iam passing std::string to a get_children() function. Iam using std::string type as inp argument. is this ok to pass std::string to an ustring. I learnt that if it is english then it will not be an issue. 

It should be possible to mix Glib::ustring and std::string if the strings contain only 7-bit ASCII characters. Such a string is legal UTF-8.

std::string node_str = "example"
Node::NodeList tmp_lst = rnode->get_children( node_str );

What if i change the inp argument to function call as node_str.c_str(). Please let me know.

I would expect both node_str and node_str.c_str() to work.

2/   Iam getting the below crash trace with the function code ( see the code after stack trace here ). This happens some times.

0x00007f2d9d3122e6 in ?? () from /lib64/libxml++-2.6.so.2
#1  0x00007f2d9cfec86a in xmlFreeNodeList__internal_alias (cur=0x7f2d9405ac4f)
    at /home/rupesh/install/rootfs_tmp1/build/libxml2/src/libxml2-2.6.30/tree.c:3382

I don't see any obvious error in your code. If you want me to troubleshoot for you, I will need a complete compilable program and a corresponding xml file to experiment with.

I see that you use a very old version of libxml2. Version 2.6.30 was released about 5 years ago. I can't see if you use an equally old version of libxml++. If the releases of libxml2 and libxml++ differ by several years, there might be some incompatibility there. This is just a guess, and it's not very probable that it's the reason for your crashes.

Kjell



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]