DirectX Release build 通过 VS2010 工作,但不是 exe [英] DirectX Release build works through VS2010, but not exe

查看:23
本文介绍了DirectX Release build 通过 VS2010 工作,但不是 exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过 Google 访问 Stack Overflow 好几年了,但到目前为止还没有问/回答任何问题,所以就这样吧.

I've been dropping by Stack Overflow for a few years now via Google, but haven't asked/answered anything as of yet, so here goes.

基本上我有一个 3D 渲染框架,用于在 DirectX 11 中设置绘图模型和地形.一切正常,通过 Visual Studio 2010 运行调试或发布版本时没有问题.

Basically I have a 3D rendering framework set up drawing models and terrain in DirectX 11. Everything works fine, with no problems when running either Debug or Release builds through Visual Studio 2010.

但是,当我导航到我的文件夹并独立运行可执行文件时,只有调试版本有效.Release 版本显示我设置的任何清晰颜色,但没有几何图形,尽管帧速率看起来好像在运行,而且我的鼠标被锁定在窗口的中心(可使用鼠标中键切换),好像程序运行良好.

However, when I navigate into my folders and run the executables independantly, only the Debug build works. The Release build displays whatever clear colour I have set, but no geometry, although the framerate looks as though it's running, and my mouse is locked to the center of the window (togglable with middle mouse button), as though the program is running fine.

我的第一个想法是我的内容无法加载,因为这在旧项目中会产生这种影响,但如果发生这种情况,该项目会崩溃,并且通过 PIX 运行 exe 已确认所有资产都已正确加载.

My first thought was that my content was failing to load, as that had this effect in an old project, but this project crashes if that happens, and running the exe through PIX has confirmed that all assets are loaded correctly.

事实证明这个问题很难用谷歌搜索,所以如果有人知道是什么导致了这个问题,我们将不胜感激.如果有帮助,我会发布一些代码,但我不知道什么是相关的.

The problem is proving difficult to google, so if anyone has any idea what could cause this, it'd be much appreciated. I'd post some code if it helped, but I don't see what would be relevant.

推荐答案

截止日期迫在眉睫,更重要的事情平息了,所以我对构建配置做了一些摆弄.

Deadlines loomed and more important matters subsided, so I did some fiddling with build configurations.

事实证明,在默认调试配置中,C/C++、代码生成、运行时库设置为多线程调试 DLL (/MDd)".在发行版中,这被设置为多线程 DLL (/MD)".切换此设置以匹配发布配置会导致构建通过 Visual Studio 运行,但在其外部显示黑屏.

Turns out that in the default debug configuration, C/C++, Code Generation, Runtime Library is set to 'Multi-threaded Debug DLL (/MDd)'. In release this is set to 'Multi-threaded DLL (/MD)'. Switching this setting to match the release configuration results in a build which runs through visual studio, but displays a black screen outside of it.

我仍然不知道这是什么原因,所以任何其他答案将不胜感激.

I still have no idea of the cause of this, so any other answers would be appreciated.

这篇关于DirectX Release build 通过 VS2010 工作,但不是 exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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