VS2005 und gtkmm-win32-devel - crashes ?
-
Hi Leute,
ich möchte den DOM xml-Parser aus dem gtkmm-Paket nutzen (libxml++).
Das Programm hängt sich sofort auf (ohne exception) sobald die Methode xmlpp::Node::get_children() aufgerufen wird (siehe Minimalbsp).Nutze VS2005. Die Ausgabe in der Console nach dem Programmabstutz (im Debugging) lautet:
First-chance exception at 0x00411e6d in testproj.exe: 0xC0000005: Access violation reading location 0xccccccd4.
Unhandled exception at 0x00411e6d in testproj.exe: 0xC0000005: Access violation reading location 0xccccccd4.
The program '[5548] testproj.exe: Native' has exited with code 0 (0x0).
[/quote]Das sieht verdammt nach Lesen außerhalb des zuläss. Speicherbereichs aus!?
Ich habe es mit den Bibliotheken aus
gtkmm-win32-devel-2.10.11-1.exe
als auch aus
gtkmm-win32-devel-2.16.0-4.exe
probiert bei beiden hängt sich das programm auf.Hoffe jmd kennt das Problem oder nimmt sich dem mal an?
Viel dank!Grüße,
derJan.Hier ein Minimalbsp:
main.cpp#include <libxml++/libxml++.h> #include <iostream> using namespace std; using namespace Glib; int main(void) { ustring filepath("C:/conf_test3.xml"); try{ xmlpp::DomParser parser; parser.parse_file( filepath ); if(parser) { const xmlpp::Node* pNode = parser.get_document()->get_root_node(); xmlpp::Node::NodeList nodelist = pNode->get_children(); //Hier hängt er sich auf } }catch(const std::exception& ex) { cout << "Exception caught: " << ex.what() << endl; } return 0; }
conf_test3.xml
<?xml version="1.0"?> <example> <examplechild id="1"> <child_of_child/> </examplechild> <examplechild id="2"> <child_of_child/> </examplechild> </example>
-
Computer sind so verdammt genau ....
Die Bibliotheken von gtk und gtkmm sind allesammt für den Release-Modus.
Der o.g. Fehler tritt also nur im Debug Modus auf. Im Release-Modus gehts.Hab mir die Bibliotheken nun selbst erzeugt. Im Debugmode muss ich dann meine eigenen laden, die für den Debug bestimmt sind.
Lange Rede kurzer Sinn:
PROBLEM GELÖST.