【问题标题】:Visual Studio 2013 *.exe is not a valid win32 application [duplicate]Visual Studio 2013 *.exe 不是有效的 win32 应用程序 [重复]
【发布时间】:2015-05-08 12:10:56
【问题描述】:

另一个“*.exe 不是有效的 win32 应用程序”问题。我有 Visual Studio 2013。我的 C++ 项目在 Windows Server 2008、Windows 8、Windows 7 上运行良好。但在 Windows Server 2003 上却不行。

我在 Stackoverflow 上查看了所有其他类似的问题,但找不到合适的解决方案。我查看了this page 并通过更改Configuration Properties > General page, change Platform Toolset to "(v120_xp)". 应用了修复程序 我仍然有这个问题。文件大小看起来也很正常。我用多线程(/MT)和Win32解决方案平台编译它。

我的包含文件是:

#include "LoadController.h"
#include <iostream>
#include <chrono>
#include <thread>
#include <random>
#include <ctime>
#include <string>
#include <stdio.h>

我通过创建平面“新项目”来创建项目(我不知道这是否重要)。我不使用它调用任何其他应用程序。该项目仅包含一个类。

提前谢谢你。

【问题讨论】:

标签: c++ visual-studio-2013


【解决方案1】:

就在我发布这个问题之后,我找到了解决方案。就像 Andrey Sorich 在xxxxxx.exe is not a valid Win32 application 的评论一样:我需要添加一个子系统。

因此,如果您在“Configuration Properties -&gt; Linker -&gt; System -&gt; Subsystem”中有一个空白,您仍然会在 XP 和 Win2003 上收到“无效的 Win32 应用程序”错误,而在 Win7 上它可以正常工作而不会出现这个烦人的错误。我一输入subsystem:console,错误就消失了。

不幸的是,他的回答没有任何“投票”。由于我无法在 stackoverflow 上以我当前的级别生成任何“投票”,我只想在我自己的问题中强调这个解决方案。

【讨论】:

    猜你喜欢
    • 2015-11-22
    • 2023-03-08
    • 1970-01-01
    • 2011-10-12
    • 1970-01-01
    • 2013-11-21
    • 2013-05-03
    • 1970-01-01
    • 2013-12-07
    相关资源
    最近更新 更多