发布构建visual c ++ [英] release build visual c++

查看:89
本文介绍了发布构建visual c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我正在写一本关于角色动画的书,有关direct3d



有本书附带的CD-ROM和cd上的示例将在调试模式下编译并运行正常但是当我编译发布版本时,我得到一个运行时错误与向量:

Hello,

I am working through a book about character animation with direct3d

There is a CD-ROM that came with the book and the examples on the cd will compile and run ok in debug mode but when I compile a release build, I get a runtime error to do with a vector:

iterator insert(const_iterator _Where, const _Ty& _Val)
        {   // insert _Val at _Where
        size_type _Off = size() == 0 ? 0 : _Where - begin();
        _Insert_n(_Where, (size_type)1, _Val);
        return (begin() + _Off);
        }



我知道如何在发布模式下编译和运行吗?



我'我想我需要在某个库中链接才能使它工作,但正如我所说它用当前的d3d9.lib和d3dx9.lib编译好。

-------- ----------------

好​​的,我尝试了一个unicode构建,并且我获得了与wofstream的访问冲突



你能帮助我深入了解正在发生的事情吗?



我已升级为visual c ++ professional并且仍然得到矢量push_back的问题。这是'正在播放的代码:




Any idea how I can compile and run in release mode?

I''m thinking that I need to link in some library to get it to work but as I say it compiles fine with the current d3d9.lib and d3dx9.lib.
------------------------
Ok, I tried a unicode build instead and I get an access violation with the wofstream

can you help me get to the bottom of what''s going on?

I''ve upgraded to visual c++ professional and still getting a problem with vector push_back. Here''s the code that''s playing up:

// Copy materials and load textures.
    for(int i=0; i<(int)NumMaterials; i++)
    {
        D3DXMATERIAL mtrl;
        memcpy(&mtrl, &pMaterials[i], sizeof(D3DXMATERIAL));

        boneMesh->materials.push_back(mtrl.MatD3D)



问题出在材料上.push_back



好​​像我传递了一个错误的值


The problem is with materials.push_back

seems like i''m passing a bad value

推荐答案

为了构建一个有效的应用程序,你需要更多。您需要头文件和其他定义。你在这里发表的是部分源代码。您将需要使用Visual Studio创建一个新项目,该项目将为您创建一个几乎为空的应用程序,这将是您工作的框架。然后你需要添加你的例程并确保你的例程被调用。简单的方法是添加一个按钮,按下该按钮时,将调用您的例程。然后将配置从DEBUG更改为RELEASE,然后按Build。然后您将获得该应用程序。
In order to build a working application you need more than that. You need header files, and other definitions. What you have published here is a partial piece of source code. You will need to use Visual Studio to create a new project, which will create for you an almost empty application, which will be the skeleton for your work. Then you need to add your routine and make sure your routine is called. The simple way is to add a button that when pressed, your routine is called. Then you change the configuration from DEBUG to RELEASE, and press Build. You will then get the application.


我终于找到了解决方案。在使用了一些断点后,我确定了问题发生的位置(使用矢量来保存材料)。



我现在使用了一个自定义向量模板类和低,看看我的程序在发布模式和调试工作。



我仍​​然不知道为什么向量没有按预期工作但现在我可以将物品附加到自定义矢量。



感谢您的回复



欢呼
I''ve finally found a solution. After using some break points I determined where the problem was occurring (the use of a vector to hold materials).

I''ve implemented a custom vector now using a template class and low and behold my program works in release mode and debug.

I still don''t know why the vector didn''t work as expected but now I can append items to the custom vector.

thanks for your reply

cheers


我在这里发布的代码是发生运行时错误的地方。我认为问题在于与视觉工作室有关;我在某处读到某些版本的构建在其他版本的Visual C ++中有效。我有标题和工作应用程序,但它只能在调试模式下运行。我正在试图找出为什么发布不会运行但它会编译好。
The code I posted here is where the runtime error is occurring. I believe the problem lies with something to do with visual studio; I read somewhere that certain release builds work in other versions of visual C++. I''ve got headers and a working application, but it will only run in debug mode. I''m trying to find out why the release won''t run but it will compile ok.


这篇关于发布构建visual c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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