- 主题:请教一个C++的编译错误
这样就能直接编译通过
g++ -c ex01.cpp -municode -D_UNICODE=USED
【 在 javame 的大作中提到: 】
: $ g++ -c ex01.cpp -municode
: ex01.cpp:40:128: error: cannot convert 'const char*' to 'const TCHAR*' {aka 'con
: st wchar_t*'} in initialization
: ...................
--
FROM 125.71.196.*
我修改成这样通过了,第一句if有错误
//#if !defined(_UNICODE) && !defined(UNICODE)
//#define _UNICODE USED
//#define UNICODE USED
//#endif
#define _UNICODE USED
【 在 poocp (慢速随机指标) 的大作中提到: 】
: 这样就能直接编译通过
: g++ -c ex01.cpp -municode -D_UNICODE=USED
--
FROM 124.78.15.*
我修改成这样通过了,谢谢!
算是结贴了。
#if !defined(_UNICODE)
#define _UNICODE USED
#endif
#if !defined(UNICODE)
#define UNICODE USED
#endif
【 在 poocp (慢速随机指标) 的大作中提到: 】
: 这样就能直接编译通过
: g++ -c ex01.cpp -municode -D_UNICODE=USED
--
FROM 124.78.15.*
_UNICODE、UNICODE这是windows头文件内部需要使用的宏,不要随便改。
一般就是定义、未定义两种状态。
【 在 javame 的大作中提到: 】
: 我修改成这样通过了,谢谢!
: 算是结贴了。
: #if !defined(_UNICODE)
: ...................
--
修改:z16166 FROM 221.218.161.*
FROM 221.218.161.*
#if !defined(_UNICODE) || !defined(UNICODE)
#define _UNICODE USED
#define UNICODE USED
#endif
是不是要把代码改成这样?
【 在 z16166 的大作中提到: 】
: _UNICODE、UNICODE这是windows头文件内部需要使用的宏,不要随便改。
: 一般就是定义、未定义两种状态。
:
--
FROM 58.37.36.*