C ++ / CLI x64 WindowsForms应用程序的入口点(VS 2015) [英] Entry point for C++/CLI x64 WindowsForms App (VS 2015)

查看:116
本文介绍了C ++ / CLI x64 WindowsForms应用程序的入口点(VS 2015)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2015 c ++ / CLI boost中遇到了与用户相同的问题: :thread :如果我同时使用boost,Windows Forms和C ++ / Cli,则我的应用在启动时崩溃。

I have the same problem as the user in Visual Studio 2015 c++/CLI boost::thread : If I use boost, Windows Forms and C++/Cli together, my app crashes on startup.

建议的解决方案对我有用(更改子系统控制台);唯一的小缺点是控制台是与GUI一起启动的。

The proposed solution works for me (change Subsystem to Console); the only small disadvantage is that the console is started alongside the GUI.

我发现了另一个解决方案(请参阅>://://bytes.com/topic/net/answers/642179 -c-cli-winforms-app-native-static-library-singletons-cra ):将入口点更改为?mainCRTStartupStrArray @@ $$ FYMHP $ 01AP $ AAVString @ System @@@ Z。

There is another solution I've found (see https://bytes.com/topic/net/answers/642179-c-cli-winforms-app-native-static-library-singletons-cra) : Changing the entry point to "?mainCRTStartupStrArray@@$$FYMHP$01AP$AAVString@System@@@Z".

但是,这仅在编译32位时有效;对于64位,符号无法解析。
我的问题:

However this only works when compiling for 32 bit; for 64 bit the symbol cannot be resolved. My questions:


  • 是否有类似的符号也适用于x64?

  • 如何找到这类符号?我试图通过dumpbin找到它们,但是没有成功!

推荐答案

啊,在隧道尽头是这个令人讨厌的问题。通过grep vc / lib / amd64中的.lib文件,可以找到正确的错误名称。弹出msvcmrt.lib,名称为:

Ah, light at the end of the tunnel for this nasty ignored problem. You can find the correct mangled name by grepping the .lib files in vc/lib/amd64. Out pops msvcmrt.lib, the name is:

?mainCRTStartupStrArray@@$$FYMHP$01EAPE$AAVString@System@@@Z

重整算法btw中的一个小错误,它不应该添加额外的E,因为这些是托管标识符。链接并运行良好,我还没有测试它是否可以解决静态初始化顺序的严重问题。这是有希望的。

Bit of a bug in the mangling algorithm btw, it shouldn't have added the extra E's because these are managed identifiers. Links and runs fine, I haven't tested yet if it solves the static initialization order fiasco problem. It is promising.

这篇关于C ++ / CLI x64 WindowsForms应用程序的入口点(VS 2015)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆