can't run snapshots in vs 2010

62 views
Skip to first unread message

han Zhou

unread,
Apr 25, 2013, 4:41:32 AM4/25/13
to ogdf-sn...@googlegroups.com
Hi, 

I always get errors running snapshots in visual studio 2010, here is the example:
int _tmain(int argc, _TCHAR* argv[])
{
Graph G;
randomSimpleGraph(G, 10, 20);
DfsAcyclicSubgraph DAS;
DAS.callAndReverse(G);
GraphIO::writeGML(G, "test.gml");
return 0;
}
After "return 0;" excuted, error occurs: Unhandled exception at 0x76fe15de in GraphTest.exe: 0xC0000005: Access violation.
If I comment all codes except "Graph G;", the error is: Run-Time Check Failure #2 - Stack around the variable 'G' was corrupted.

But the v. 2012.07 (Sakura) version works well.

Han

Carsten Gutwenger

unread,
Apr 25, 2013, 8:29:04 AM4/25/13
to ogdf-sn...@googlegroups.com
You can try the following: Create a new project within your VS solution, but select "empty project" to avoid that VS creates some initial source files and stuff. Then create your own main.cpp file and write a usual int main() function (without the _TCHAR stuff). Set the project properties required for OGDF (include dirs, libraries, OGDF_DEBUG preprocessor flag for Debug build) and build the project.

Does the same error still occurs? Is it in Debug and Release mode?

Regards,
Carsten

han Zhou

unread,
Apr 25, 2013, 1:05:47 PM4/25/13
to ogdf-sn...@googlegroups.com
Thanks Carsten. No errors now, it works well in both Debug/Release Mode.

But, does it mean that I can't use odgf in win32 app?

Han

Carsten Gutwenger

unread,
Apr 25, 2013, 3:33:42 PM4/25/13
to ogdf-sn...@googlegroups.com
It's probably just a little inconsistency in the project configurations (ogdf lib and win32 executable), this should be solvable.

Carsten
Reply all
Reply to author
Forward
0 new messages