[英]Why does my binary run on Windows 8 but not on Windows 7?
I have a Project in VC2013 x64 which compiles successfully. 我在VC2013 x64中有一个可以成功编译的项目。 It also runs without any Problems on Win8, but crashes immediately before reaching main() on Win7 with the message:
它在Win8上也没有任何问题,但在出现以下消息到达Win7上的main()之前立即崩溃:
"The application was unabel to start correctly (0x000007b). click OK to Close the application." “该应用程序无法正常启动(0x000007b)。单击“确定”关闭该应用程序。”
I already tried installing all vc runtimes there are. 我已经尝试安装所有的vc运行时。 I tried it on several Win7 and Win8 Systems and it's always the same.
我在多个Win7和Win8系统上进行了尝试,并且始终相同。
I'm not sure what could cause this, I also don't know which details about the projects might be important to figure the issue out. 我不确定是什么原因造成的,我也不知道有关项目的哪些详细信息对于弄清问题可能很重要。 I wrote mayn Programs in VC before and never had such an issue.
我以前用VC编写过mayn程序,从没遇到过这样的问题。 That's why I didn't check if the program runs on non-win8 pc during development, since my dev machine currently is win8.
这就是为什么我在开发期间不检查程序是否在非win8 pc上运行的原因,因为我的开发机当前是win8。 I'll post a few facts about this solution, maybe that info helps:
我将发布有关此解决方案的一些事实,也许该信息会有所帮助:
Also, the same happens if I install VC2013 on a win7 pc. 另外,如果我在win7电脑上安装VC2013,也会发生同样的情况。 It compiles perfectly but doesn't run on Win7 and crashes with the same message.
它可以完美编译,但不能在Win7上运行,并且崩溃并显示相同的消息。 I also tried swithing to the vc2012 toolset which results in the same Crash.
我还尝试切换到vc2012工具集,这会导致相同的崩溃。
If you have any idea what could cause this, please post. 如果您有任何可能导致此问题的想法,请发布。 I'm happy for even ideas that could cause this.
我对可能导致这种情况的想法感到高兴。
Thx Marc 特克斯·马克
[edit] I just tried adding [编辑]我刚刚尝试添加
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#include <WinSDKVer.h>
in front of 在...前面
#include <SDKDDKVer.h>
in targetver.h . 在targetver.h中。 It still crashes with that error.
它仍然因该错误而崩溃。 [/edit]
[/编辑]
Ha! 哈! I found it!
我找到了! It was the boost libraries having some issue when compiled without /clr but linked to a program that uses /clr.
在没有/ clr的情况下进行编译,但链接到使用/ clr的程序时,boost库存在一些问题。 The workaround I used is linking boost dynamically by using
我使用的解决方法是通过使用
#define BOOST_THREAD_DYN_LINK
globally and putting the corresponding dlls in the work dir of the process. 全局并将相应的dll放入进程的工作目录中。 There is more to read about this, it seems to be an old Problem.
关于这一点,还有更多要阅读的内容,这似乎是一个古老的问题。 The new Thing seems to be that it runs on Win8 anyways.
无论如何,新的东西似乎是它可以在Win8上运行。 The links I found just report it doesn't work at all, maybe they haven't tried it on Win8:
我发现的链接只是报告它根本不起作用,也许他们没有在Win8上尝试过:
Using boost in CLR 在CLR中使用Boost
Boost Threads with CLR 使用CLR增强线程
boost mutex C++/CLI problems 增强互斥C ++ / CLI问题
http://lists.boost.org/threads-devel/2009/10/0502.php http://lists.boost.org/threads-devel/2009/10/0502.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.