Abnormal program termination on shutdown with TRESTClient

最后都变了- 提交于 2020-06-23 16:48:15

问题


When a program that has a TRESTClient components is shutdown, it will show an "Abnormal Program Termination" error.

Recently, we've upgraded a project from C++Builder 2009 to C++Builder 10.2 Tokyo. Afterwards, we added the new TRESTClient to our project. Now, every time we try to close the application, it shows this error. This means that an abort() call is probably made.

We've run the debugger until the end of the tWinMain() function, which shows that it happens after the return. This shows that the exception is thrown during application cleanup. In the included call stack, it shows Data::Bind::Objectscope::Finalization, and UnregisterScope() being called from there. This is most likely where the exception is thrown.

This problem seems very similar to the issue in this forum post. Remy Lebeau describes this as a bug where, if an item is not found while unregistering, an exception is thrown.


回答1:


This is fixed as of 10.3.2: https://stackoverflow.com/a/56195297/6852057

To fix it in an older version:

The issue has to do with the link order of two libraries, namely "bindengine.lib" and "bindcomp.lib".

When "bindcomp.lib" is linked in BEFORE "bindengine.lib" you will see this problem, and for some frustrating reason the IDE insists in placing the them in wrong order. So to resolve the issue.

  1. close your project that shows the problem in the IDE.
  2. load the project's .cbproj into a text editor (HINT: NOT the IDE)
  3. search for the "" tag.
  4. switch the position of the two libs "...;bindengine.lib;bindcomp.lib;... " so as to have the "bindengine" BEFORE "bindcomp".
  5. repeat the process for any other "" (as you might have more than one configuration)
  6. repeat 3. to 5. for the tag ""
  7. save the project file.
  8. open it in the IDE and Build OR Clean and Make the project again. So that the EXE gets re-linked.


来源:https://stackoverflow.com/questions/60870300/abnormal-program-termination-on-shutdown-with-trestclient

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!