A call to PInvoke function '[…]' has unbalanced the stack

后端 未结 5 1169
失恋的感觉
失恋的感觉 2020-11-27 06:03

I\'m getting this weird error on some stuff I\'ve been using for quite a while. It may be a new thing in Visual Studio 2010 but I\'m not sure.
I\'m trying to call a unam

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 06:12

    In my case (VB 2010 and DLL compiled with Intel Fortran 2011 XE) the problem exists when my application targets .NET Framework 4. If I change targeted framework to version 3.5, then everything works fine as expected. So, I would guess the reason is something introduced in .Net Framework 4 but I have no idea at the moment which one

    Update: The problem was solved by recompiling Fortran DLL and explicitly specifying STDCALL as calling convention for export names in the DLL.

提交回复
热议问题