简体   繁体   English

为什么我的二进制文件可以在Windows 8上运行而不能在Windows 7上运行?

[英]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: 我将发布有关此解决方案的一些事实,也许该信息会有所帮助:

  • It uses boost. 它使用升压。
  • it is c++/clr 它是c ++ / clr
  • it references another Project which is written in c# and uses some classes from it. 它引用了另一个用c#编写的项目,并使用了其中的一些类。 The Platform target of this Project is set to "x64". 该项目的平台目标设置为“ x64”。
  • it uses curl 它使用卷曲
  • it uses vmware vddk (which is a C Library) 它使用vmware vddk(这是一个C库)

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.

相关问题 Windows服务无法运行我的类方法 - Windows services does not run my class method 为什么该命令不能在Windows XP上运行? - Why the command does not run on Windows XP? 为什么 Windows Phone 8 模拟器不能在 Windows 8.1 中运行? - Why Windows Phone 8 emulator does not run in Windows 8.1? 为什么我的C#Windows窗体中的代码不起作用? - Why does my code in my c# windows form not work? 为什么我的平台target =任何CPU Windows服务项目在安装后都作为32位进程在WOW64中运行? - Why does my platform target=Any CPU windows service project run in the WOW64 as a 32bit process when installed? 为什么Windows Phone应用程序在单击按钮时崩溃? - Why does my windows phone app crash on button click? 为什么我的线程在显示Windows窗体后立即终止? - Why Does my Thread Terminate Immediately After Showing a Windows Form? 为什么我的GTK#编译二进制文件(由MonoDevelop创建)在Windows上不起作用? - Why doesn't my GTK# compiled binary (created with MonoDevelop) work on Windows? 为什么我的HTTP侦听器程序可以用作Windows Form项目,但不能用作Windows Service? - Why does my HTTP listener program works as Windows Form project but not in Windows Service? 为什么我无法在带有Windows 8.1的Visual Studio C#Pro 2012上运行Windows 8.0电话仿真器? - Why i cant run windows 8.0 phone emulator on my visual studio c# pro 2012 with windows 8.1?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM