【问题标题】:Borland C++ Builder compile errorBorland C++ Builder 编译错误
【发布时间】:2009-10-29 12:46:09
【问题描述】:

我在 XP PC 上使用 Borland C++ Builder 6。当我编译一个引用 crtdbg 文件的软件单元时,我收到以下错误消息:

/* Borland version of Microsoft CRTDBG.H header file
   This is used by MFC and ATL.
*/

/*
 *      C/C++ Run Time Library - Version 11.0
 *
 *      Copyright (c) 1999, 2002 by Borland Software Corporation
 *      All Rights Reserved.
 *
 */

/* $Revision: 9.4.2.1 $ */

#ifndef _INC_CRTDBG
#define _INC_CRTDBG

#ifndef __UTILCLS_H

#include <windows.h>

#ifdef __cplusplus
extern "C" {
#endif
/* Prototypes for internal RTL helper functions: */
void _ErrorMessage(const char *__message);
void _ErrorExit   (const char *__message);
#ifdef __cplusplus
}
#endif

/* Asserts */

#if !defined(_DEBUG)

#define _ASSERT(expr) ((void)0)
#define _ASSERTE(expr) ((void)0)

#else /* !defined(_DEBUG) */

#define _ASSERT(a) _ASSERTE(a)
#define  _ASSERTE(expr) do {                                                            \
  if (!(expr) && __ASSERTE_Helper (#expr, __FILE__, __LINE__) == IDCANCEL)              \
    ::DebugBreak();                                                                     \
} while (0)

/* _ASSERTE helper routine returns: MB_YES, MB_NO or MB_CANCEL
*/
__inline int __ASSERTE_Helper(bool expr, char *file, int line)
{
  TCHAR msg[256*2];
  ::wsprintf(msg, _T("%s failed - %s/%d"), expr, file, line);
/*  throw (msg); */
  _ErrorExit(msg);
  return 0; /* Never really gets here */
}

#endif /* !defined(_DEBUG) */

#endif /* __UTILCLS_H */

#endif /* _INC_CRTDBG */



[C++ Error] crtdbg.h(52): E2268 Call to undefined function '_T'
[C++ Error] crtdbg.h(52): E2034 Cannot convert 'int' to 'const char *'
[C++ Error] crtdbg.h(52): E2340 Type mismatch in parameter 2 (wanted 'const char *', got 'int')

这有什么问题?

【问题讨论】:

    标签: c++builder


    【解决方案1】:

    您应该添加 TCHAR.H 包含(或 Borland 等效项)。

    _T() 是一个将 8 位字符串转换为宽字符格式的宏。

    【讨论】:

      猜你喜欢
      • 2014-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多