none
Disabling C/C++ Languange Run-Time Type Info RRS feed

  • 問題

  • When I disable Run-Time Type info of the C/C++ -->  Language in the Property pages

    my program will produce an

    error:

    Unhandled exception at 0x7c812a5b in Eight_d.exe: Microsoft C++ exception: __non_rtti_object @ 0x0012fa94.

     

    and jump to the file

    dbgheap.c:

    _CRTIMP void * __cdecl malloc ( size_t nSize )
    {
            void *res = _nh_malloc_dbg(nSize, _newmode, _NORMAL_BLOCK, NULL, 0);  <<--- crashes here

            RTCCALLBACK(_RTC_Allocate_hook, (res, nSize, 0));

            return res;
    }

    this does not occurr when I Enable the Run-Time Type info.

    2007年9月3日 上午 05:05

解答

  • Sorry I noticed that it says to Enable Run-Time Type Info if I use dynamic_cast ( which I am ), so I guess I'll just leave it enabled (though I would like to know why it crashes when I disable it). Thanks a lot for helping tihs.

     

    2007年9月4日 上午 08:00

所有回覆

  • HI,

     

    您的程式有很大嗎? 貼上來讓其他人可以拿去試驗看看

     

    tihs

    2007年9月4日 上午 02:43
  • Sorry I noticed that it says to Enable Run-Time Type Info if I use dynamic_cast ( which I am ), so I guess I'll just leave it enabled (though I would like to know why it crashes when I disable it). Thanks a lot for helping tihs.

     

    2007年9月4日 上午 08:00
  • HI,

     

    要轉型還可以使用reinterpret_cast

     

    tihs

    2007年9月5日 上午 02:28