eVC link时的const type

    技术2022-05-11  200

    将C++的程序移植到Windows CE上时,如果使用异常机制,会发生如下错误:

    error LNK2001:unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)

    原因如下:

    对数据类型使用“throw”构造、“catch”构造或同时使用两者的 C++ 异常处理代码需要 RTTI 支持来标识异常的类型。没有 RTTI 库,类型化的 C++ 异常处理代码将导致类似于以下错误信息的链接器错误信息:

    error LNK2001:unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)

    例如,没有 RTTI 库,以下代码将导致前面的链接器错误:

    try { // The code here can raise exceptions.} catch(int i) { // Optional exception handling logic goes here. } 链接器返回此错误,原因是它找不到对 int 类型的异常进行类型标识所需的 RTTI 库。

    try { // The code here can raise exceptions.} catch(int i) { // Optional exception handling logic goes here. }链接器返回此错误,原因是它找不到对 int 类型的异常进行类型标识所需的 RTTI 库。 链接器返回此错误,原因是它找不到对 int 类型的异常进行类型标识所需的 RTTI 库。 解决的方法是下载RTTI的库,详细信息参见: http://support.microsoft.com/default.aspx?scid=kb;[LN];830482

    最新回复(0)