[vtkusers] ESP value error when including file using WXWidget library

Sean McInerney seanm at nmr.mgh.harvard.edu
Mon May 17 10:21:10 EDT 2004


   First off, I think this is a Windows-only runtime error and may be 
specific to MSVC++.

   The same error occurred for me using VTK with FLTK, but was not 
directly related to either toolkit. Instead, the error was produced by 
non-member functions used as callbacks to vtkProcessObject progress 
events. The problem was eliminated by the switch to use of vtkCommand 
functors. Without special Microsoft C++ extensions garbage, I think the 
runtime environment sees global callback functions as C calls and is 
unable to use them since they were compiled as C++. Without resorting to 
uglifying your source with '__cdecl' (or something else?), simply making 
your callbacks static members of a class might eliminate the "ESP" error.

Also consult the evil empire itself:

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_core_Calling_Conventions_Topics.asp>

-Sean

> 
> Doing a google search leads to:
> 
> The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
> Solution: do NOT use the compile option "/Gz", this option changes the calling convention
> 
> [http://www.forumplanet.com/planetquake/topic.asp?fid=1491&tid=1332426]
> 
> Also please send us the piece of code that produce this error. Is this is VTK, wxWidgets, or your code ?
> 
> Mathieu
> 
> 
> 
>>Hello vtk user
>> 
>>I have a problem when i run my programm this message appears :
>>"The ESP value was not properly save across function call ..."
>>This occures only when i include in my vtk file an other file which uses WxWidget library.
>>I 'm lost because the error appears when i use a function which doesn't use the object implemented with WX ...
>>If somebody thinks know the problem write me please !!!!!
>>Thank's
>>Ludo
>>



More information about the vtkusers mailing list