最新的easymule版本,使用vs2005编译

最新的easymule版本,使用win7系统,vs2005编译错误解决方案。

这里只是我这里出现的错误,不同的人出现的错误不一样。

这里http://www.verycd.com/groups/eMuleDev/209863.topic/page1有个相对比较全的方案。



首先打开easyMule_Libs.sln,编译
1. 
\src\cximage\ximatran.cpp(183) : error C2666: “div”: 2 个重载有相似的转换
c:\program files\microsoft visual studio 8\vc\include\stdlib.h(508): 可能是“ldiv_t div(long,long)”
c:\program files\microsoft visual studio 8\vc\include\stdlib.h(482): 或“div_t div(int,int)”
试图匹配参数列表“(long, int)”时
\src\cximage\ximatran.cpp(301) : error C2666: “div”: 2 个重载有相似的转换
c:\program files\microsoft visual studio 8\vc\include\stdlib.h(508): 可能是“ldiv_t div(long,long)”
c:\program files\microsoft visual studio 8\vc\include\stdlib.h(482): 或“div_t div(int,int)”
试图匹配参数列表“(long, int)”时


解决:div的参数强制转换为long


2. 
Assembling: c:\Users\niko\Desktop\testEasymule\zlib\inffas32.asm
\zlib\inffas32.asm(647) : error A2070: invalid instruction operands
\zlib\inffas32.asm(649) : error A2070: invalid instruction operands
\zlib\inffas32.asm(663) : error A2070: invalid instruction operands
\zlib\inffas32.asm(720) : error A2070: invalid instruction operands
Project : error PRJ0019: 工具从"Assembling..."


解决办法是把inffas32.asm中的4处出错的类似


 movd mm4, [esp+0]


的汇编代码,添加dword ptr修饰符,改为


 movd mm4,dword ptr [esp+0]


具体查看:http://blog.csdn.net/kellerxq/article/details/1337192


3. 
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(292) : error C2664: “bool CryptoPP::CodeLessThan::operator ()(const 


CryptoPP::HuffmanDecoder::code_t,const CryptoPP::HuffmanDecoder::CodeInfo &)”: 不能将参数 1 从“const CryptoPP::HuffmanDecoder::CodeInfo”转换为“const 


CryptoPP::HuffmanDecoder::code_t”
        没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
        C:\Program Files\Microsoft Visual Studio 8\VC\include\algorithm(2099): 参见对正在编译的函数 模板 实例化“bool std::_Debug_lt_pred<_Pr,_Ty,T>(_Pr,const _Ty1 


&,const _Ty2 &,const wchar_t *,unsigned int)”的引用
        with
        [
            _Pr=CryptoPP::CodeLessThan,
            _Ty=CryptoPP::HuffmanDecoder::code_t,
            T=CryptoPP::HuffmanDecoder::CodeInfo,
            _Ty1=CryptoPP::HuffmanDecoder::code_t,
            _Ty2=CryptoPP::HuffmanDecoder::CodeInfo
        ]
        C:\Program Files\Microsoft Visual Studio 8\VC\include\algorithm(2113): 参见对正在编译的函数 模板 实例化“_FwdIt 


std::_Upper_bound<std::_Vector_const_iterator<_Ty,_Alloc>,unsigned int,__w64 int,_Pr>(_FwdIt,_FwdIt,const unsigned int &,_Pr,_Diff *)”的引用
        with
        [
            _FwdIt=std::_Vector_const_iterator<CryptoPP::HuffmanDecoder::CodeInfo,CryptoPP::AllocatorWithCleanup<CryptoPP::HuffmanDecoder::CodeInfo>>,
            _Ty=CryptoPP::HuffmanDecoder::CodeInfo,
            _Alloc=CryptoPP::AllocatorWithCleanup<CryptoPP::HuffmanDecoder::CodeInfo>,
            _Pr=CryptoPP::CodeLessThan,
            _Diff=__w64 int
        ]
        .\zinflate.cpp(148): 参见对正在编译的函数 模板 实例化“_FwdIt 


std::upper_bound<std::_Vector_const_iterator<_Ty,_Alloc>,CryptoPP::HuffmanDecoder::code_t,CryptoPP::CodeLessThan>(_FwdIt,_FwdIt,const unsigned int &,_Pr)”的引用
        with
        [
            _FwdIt=std::_Vector_const_iterator<CryptoPP::HuffmanDecoder::CodeInfo,CryptoPP::AllocatorWithCleanup<CryptoPP::HuffmanDecoder::CodeInfo>>,
            _Ty=CryptoPP::HuffmanDecoder::CodeInfo,
            _Alloc=CryptoPP::AllocatorWithCleanup<CryptoPP::HuffmanDecoder::CodeInfo>,
            _Pr=CryptoPP::CodeLessThan
        ]




C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(303) : error C2664: “bool CryptoPP::FreqLessThan::operator ()(const CryptoPP::HuffmanNode &,const 


CryptoPP::HuffmanNode &) const”: 不能将参数 2 从“const int”转换为“const CryptoPP::HuffmanNode &”
        原因如下: 无法从“const int”转换为“const CryptoPP::HuffmanNode”
        无构造函数可以接受源类型,或构造函数重载决策不明确
        C:\Program Files\Microsoft Visual Studio 8\VC\include\algorithm(2099): 参见对正在编译的函数 模板 实例化“bool std::_Debug_lt_pred<_Pr,_Ty,T>(_Pr,const _Ty1 


&,_Ty2 &,const wchar_t *,unsigned int)”的引用
        with
        [
            _Pr=CryptoPP::FreqLessThan,
            _Ty=int,
            T=CryptoPP::HuffmanNode,
            _Ty1=int,
            _Ty2=CryptoPP::HuffmanNode
        ]
        C:\Program Files\Microsoft Visual Studio 8\VC\include\algorithm(2113): 参见对正在编译的函数 模板 实例化“_FwdIt 


std::_Upper_bound<CryptoPP::HuffmanNode*,_Ty,std::iterator_traits<_Iter>::difference_type,_Pr>(_FwdIt,_FwdIt,const _Ty &,_Pr,_Diff *)”的引用
        with
        [
            _FwdIt=CryptoPP::HuffmanNode *,
           _Ty=int,
            _Iter=CryptoPP::HuffmanNode *,
            _Pr=CryptoPP::FreqLessThan,
            _Diff=std::iterator_traits<CryptoPP::HuffmanNode *>::difference_type
        ]
        .\zdeflate.cpp(115): 参见对正在编译的函数 模板 实例化“_FwdIt std::upper_bound<CryptoPP::HuffmanNode*,int,CryptoPP::FreqLessThan>(_FwdIt,_FwdIt,const _Ty 


&,_Pr)”的引用
        with
        [
            _FwdIt=CryptoPP::HuffmanNode *,
            _Ty=int,
            _Pr=CryptoPP::FreqLessThan
        ]


解决:将debug改为release。


4. 
.\ximatran.cpp(183) : error C2679: 二进制“=”: 没有找到接受“ldiv_t”类型的右操作数的运算符(或没有可接受的转换)
        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h(82): 可能是“_div_t &_div_t::operator =(const _div_t &)”
        试图匹配参数列表“(div_t, ldiv_t)”时
.\ximatran.cpp(301) : error C2679: 二进制“=”: 没有找到接受“ldiv_t”类型的右操作数的运算符(或没有可接受的转换)
        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h(82): 可能是“_div_t &_div_t::operator =(const _div_t &)”
        试图匹配参数列表“(div_t, ldiv_t)”时


解决:将div_r = div((long)(y + dlineup), (long)8);中div_r的类型改为ldiv_t




编译源码easyMule.sln:


1. 
.\WorkLayer\FtpClientReqSocket.cpp(51) : error C2440: “初始化”: 无法从“const char *”转换为“char *”
.\WorkLayer\otherfunctions.cpp(3863) : error C2440: “初始化”: 无法从“const wchar_t *”转换为“LPTSTR”
.\WorkLayer\UPnpNat.cpp(752) : error C2440: “=”: 无法从“const char *”转换为“char *”
解决: 加上强制类型转换


2.


1>.\WorkLayer\EncryptedStreamSocket.cpp(362) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>.\WorkLayer\EncryptedStreamSocket.cpp(493) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>.\WorkLayer\EncryptedStreamSocket.cpp(591) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int


解决方案:
把 const bySupportedEncryptionMethod
改成 const EEncryptionMethods bySupportedEncryptionMethod


3.
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\wtime.inl(37) : error C2664: “_wctime32”: 不能将参数 1 从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\wtime.inl(43) : error C2664: “errno_t _wctime32_s(wchar_t *,size_t,const __time32_t *)”: 不能将参数 3 


从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(32) : warning C4244: “参数”: 从“time_t”转换到“__time32_t”,可能丢失数据
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(32) : warning C4244: “参数”: 从“time_t”转换到“__time32_t”,可能丢失数据
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(38) : error C2664: “_ctime32”: 不能将参数 1 从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(44) : error C2664: “errno_t _ctime32_s(char *,size_t,const __time32_t *)”: 不能将参数 3 从“const 


time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(51) : error C2664: “_gmtime32”: 不能将参数 1 从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(57) : error C2664: “_gmtime32_s”: 不能将参数 2 从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(64) : error C2664: “_localtime32”: 不能将参数 1 从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(69) : error C2664: “_localtime32_s”: 不能将参数 2 从“const time_t *”转换为“const __time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(81) : error C2664: “_time32”: 不能将参数 1 从“time_t *”转换为“__time32_t *”
1>        与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换


解决方案:
去掉stdafx.h里的以下几行
#ifndef _USE_32BIT_TIME_T
#define _USE_32BIT_TIME_T
#endif


4. 
1>C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include/afxres.h(28) : warning RC4005: 'IDR_MANIFEST' : redefinition
1>.\emule.rc(2629) : error RC2176 : old DIB in res\Mule.ico; pass it through SDKPAINT


原Mule.ico已损坏,需要拿另外一个进行替换。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值