开发问题汇总

1. 本人在编译VC工程时,遇到如下错误:  
  MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _getenv   already   defined   in   LIBCMTD.lib(getenv.obj)  
  MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _free   already   defined   in   LIBCMTD.lib(dbgheap.obj)  
  MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _calloc   already   defined   in   LIBCMTD.lib(dbgheap.obj)  
  MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _malloc   already   defined   in   LIBCMTD.lib(dbgheap.obj)  

解答:是由于该主程序和其用的lib库所使用的运行库不一致的原因,vc6到project->setting->c/c++->Code   Generation->Use   run-time   library处更改;vc7到c/c++ ->code generation->run-time   library处更改。

 

2.  error C2664: 'RpcStringFreeW' : cannot convert parameter 1 from 'unsigned char **__w64 ' to 'RPC_WSTR *'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

解决办法:

a:There reason you get the error is that the compiler treat wchar_t as an built-in type, and so TCHAR* maps to wchar_t* and that's not the same as a RPC_WSTR which map to a unsigned short*.To get rid of the error you can change the compiler setting to not treat the wchar_t as an built-in type.

b:"项目属性->常规->字符集"项中的值修改为 "未设置"

3.error C2229: struct 'P_GC_Regist' has an illegal zero-sized array

解决:gnu c里允许存在大小为0的数组作为一个占位符,但是标准c和c++里不允许如此用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值