简体   繁体   English

在 VS2015 中构建会出现 SideBySide 错误

[英]Building in VS2015 gives SideBySide error

I have an x86 C++ app that works in VS2013 and I'm upgrading to VS2015.我有一个在 VS2013 中运行的 x86 C++ 应用程序,我正在升级到 VS2015。 The build and link work fine but when I run I get an error:构建和链接工作正常但是当我运行时出现错误:

Unable to start program.无法启动程序。 This application has failed to start because the application configuration is incorrect.此应用程序未能启动,因为应用程序配置不正确。 Review the manifest file for possible errors.检查清单文件是否存在可能的错误。 Reinstalling the application may fix this problem.重新安装应用程序可能会解决此问题。 For more details, please see the application event log.有关详细信息,请参阅应用程序事件日志。

The application event log shows:应用程序事件日志显示:

Activation context generation failed for "MyApp.exe". “MyApp.exe”的激活上下文生成失败。 Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" could not be found.无法找到依赖程序集 Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762"。 Please use sxstrace.exe for detailed diagnosis.请使用 sxstrace.exe 进行详细诊断。

So I ran sxstrace and got:所以我运行 sxstrace 并得到:

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = MyApp.exe
    AssemblyDirectory = MyApp\Debug\
    Application Config File = 
-----------------
INFO: Parsing Manifest File MyApp.exe.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762"
INFO: Resolving reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762".
    INFO: Resolving reference for ProcessorArchitecture WOW64.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC80.DebugCRT\8.0.50727.762__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC80.DebugCRT\8.0.50727.762__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL.
                INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT.DLL.
                INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT.MANIFEST.
                INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.DLL.
                INFO: Attempt to probe manifest at MyApp\Debug\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762".
ERROR: Activation Context generation failed.
End Activation Context Generation.

I'm not sure how this helps and I still don't understand why I'm getting this error if I built the app from scratch in VS2015.我不确定这有何帮助,而且我仍然不明白如果我在 VS2015 中从头开始构建应用程序为什么会出现此错误。 I've tried installing Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) which corresponds to the version 8.0.50727.762 but it hasn't helped.我已经尝试安装与版本 8.0.50727.762 相对应的Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) ,但它没有帮助。

A lot of the older posts on this subject (eg Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one? ) mention checking the.manifest file generated by the build but I can't find one.很多关于这个主题的旧帖子(例如,当我在一台机器上开发 EXE 并在另一台机器上运行时,为什么安装 vcredist_x86.exe 不能修复 SideBySide 错误? )提到检查构建生成的 .manifest 文件,但我找不到一个。 Does VS2015 no longer generate them? VS2015 不再生成它们了吗?

One of your used library is build against the Debug Runtime of Vs2005 (Microsoft.VC80. Debug CRT).您使用的库之一是针对 Vs2005 的调试运行时构建的(Microsoft.VC80。调试CRT)。 Those debug files are NOT part of the normal Visual C++ 2005 SP1 Redistributable Package.这些调试文件不是普通 Visual C++ 2005 SP1 Redistributable Package 的一部分。

Do a trial & error search to figure out which library and get the release version which uses the release Dlls which are part of the Redistributable Package.进行试错搜索以找出哪个库并获取使用作为可再发行组件包一部分的发行 Dll 的发行版本。

What type of 3d party libraries are you using and how are they being linked?您使用的是什么类型的 3d 派对库,它们是如何链接的? For example are you using DLLs, Libs or both?例如,您使用的是 DLL、库还是两者都使用? If you are using statically linked 3rd party libraries, then they must be compiled and built using the same version of VS you are using with the same code generation flags.如果您使用的是静态链接的第 3 方库,则必须使用与您使用的相同版本的 VS 以及相同的代码生成标志来编译和构建它们。 You may also want to visit the developer's websites of those libraries and look to see if they have a newer version and one that is already compiled with your current version of VS.您可能还想访问这些库的开发人员网站,看看它们是否有更新的版本以及是否已使用您当前版本的 VS 编译。 If they only have 2010, 12 or 13 they should work but you will have to open them in 2015 and build them out yourself如果他们只有 2010、12 或 13,他们应该可以工作,但你必须在 2015 年打开它们并自己构建它们

For example;例如; I use libpng, openal, ogg-vorbis, glm & others, For all of the 3rd party libraries that my applications depend on I have created a file directory where they are stored and I created environment variables on my main machine for an easier linking process.我使用 libpng、openal、ogg-vorbis、glm 和其他,对于我的应用程序所依赖的所有第 3 方库,我创建了一个存储它们的文件目录,并在我的主机上创建了环境变量以简化链接过程. For all of these libraries except for glm since glm is a headers only library I had to create different environment variables for each version of visual studio I'm using;对于除 glm 之外的所有这些库,因为 glm 是一个仅包含标头的库,所以我必须为我使用的每个版本的 visual studio 创建不同的环境变量; for example OGG-Vorbis are 2 different libraries used for doing audio;例如 OGG-Vorbis 是两个用于制作音频的不同库; so I would have OGG_SDK_2010, VORBIS_SDK_2010... OGG_SDK_2015, VORBIS_SDK_2015 where these libraries being the newest version from their websites are loaded and built out in both release & debug versions of each version of Visual Studio that I may be using.所以我会有 OGG_SDK_2010,VORBIS_SDK_2010 ... OGG_SDK_2015,VORBIS_SDK_2015,其中这些库是他们网站的最新版本,在我可能使用的每个版本的 Visual Studio 的发布和调试版本中加载和构建。

Before I redid my pc I did have VS2008, 2010, 2012, 2013 and 2015;在我重做我的电脑之前,我确实有 VS2008、2010、2012、2013 和 2015; now that I reinstalled my OS I currently only have VS2013 & 2015. So any of my older programs from VS2008, VS2010 & VS2012 I will have to first port them to 2013 and fix any dependencies and take care of any deprecation.现在我重新安装了我的操作系统,我目前只有 VS2013 和 2015。因此我必须先将 VS2008、VS2010 和 VS2012 中的任何旧程序移植到 2013 并修复所有依赖项并处理任何弃用问题。 Once that process is completed I'll then be able to port them over to 2015.一旦该过程完成,我就可以将它们移植到 2015 年。

Now, from my experience on porting one of my programs over to 2015 from 2013 there was a little bit of a process that had to be done, however, I do not recall off of the top of my head exactly what had to be done.现在,根据我将我的一个程序从 2013 年移植到 2015 年的经验,有一些必须完成的过程,但是,我不记得到底需要做什么。 I do know that it did take a little bit of time reading different threads and trial and error to get everything to work properly.我知道确实需要花一点时间阅读不同的线程并反复试验才能使一切正常工作。

It may also be that you could be using a library that has not been updated and that there is currently no more work or support being done for it that the library dependency that you may have may be considered deprecated in itself and if that is the case, then you may have to do some research to find an alternative library that will fit your needs.也可能是您可能正在使用尚未更新的库,并且目前没有更多的工作或支持为它完成,您可能拥有的库依赖项本身可能被认为已弃用,如果是这种情况,那么您可能需要做一些研究才能找到满足您需求的替代库。 Once you find the appropriately library, then it is a matter of stripping out all of the old method calls and replacing them with the equivalent calls to the newer library.一旦找到合适的库,接下来就是剥离所有旧方法调用并将它们替换为对新库的等效调用。 However in some cases this may involve a complete rewrite of your existing program.然而,在某些情况下,这可能涉及对现有程序的完全重写。

For example;例如; I use OpenGL and when I first started to learn it I was using version 1.0 where everything that was used to do render calls was all done on the CPU.我使用 OpenGL,当我第一次开始学习它时,我使用的是 1.0 版,其中用于执行渲染调用的所有内容都在 CPU 上完成。 Now that I'm using Modern OpenGL and using GLSL Shaders on the GPU and have successfully created a 3D Graphics Shader Rendering Engine;现在我正在使用现代 OpenGL 并在 GPU 上使用 GLSL 着色器并成功创建了 3D 图形着色器渲染引擎; the transition from OpenGL 1.0 to 4.5 was quite a bit to take in and the difference between the two versions of the same Library or API by OpenGL was a challenge.从 OpenGL 1.0 到 4.5 的过渡需要接受很多东西,而且 OpenGL 的同一库或 API 的两个版本之间的差异是一个挑战。 Porting from an older version of a compiler to a newer version is sometimes fairly easy like porting from 2012 to 2013, there wasn't that much of an overhead change, but sometimes porting from an old version to a newer version can be tedious such as going from 2005 to 2015.从旧版本的编译器移植到新版本有时相当容易,就像从 2012 年移植到 2013 年一样,没有太多开销变化,但有时从旧版本移植到新版本可能很乏味,例如从 2005 年到 2015 年。

Also do not forget to check these 3rd party libraries props files to make sure they are pointing to the correct version of VS.也不要忘记检查这些第 3 方库道具文件以确保它们指向正确版本的 VS。

@magicandre1981's answer is correct but didn't give any clues how to help track it down. @magicandre1981 的回答是正确的,但没有提供任何线索来帮助追踪它。 I eventually noticed that when Visual Studio links my app it prints out:我最终注意到,当 Visual Studio 链接我的应用程序时,它会打印出:

glew32sd.lib(glew.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'glew32sd.lib(glew.obj)' or at 'MyApp\Debug\vc80.pdb'; linking object as if no debug info

I rebuilt glew32sd.lib from the glew source code and my problem was fixed.我从glew 源代码重建了 glew32sd.lib,我的问题得到了解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM