S.l.e!ep.¢%

像打了激速一样,以四倍的速度运转,开心的工作
简单、开放、平等的公司文化;尊重个性、自由与个人价值;
posts - 1098, comments - 335, trackbacks - 0, articles - 1
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

编译 Emule

Posted on 2009-12-31 14:53 S.l.e!ep.¢% 阅读(979) 评论(0)  编辑 收藏 引用 所属分类: VC


1. 首次编译的错误
>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\..\src\mfc\afximpl.h(631) : error C2059: syntax error : '<L_TYPE_raw>'
>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\..\src\mfc\afximpl.h(631) : error C2238: unexpected token(s) preceding ';'
>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\..\src\mfc\afximpl.h(635) : error C2059: syntax error : '<L_TYPE_raw>'
>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\..\src\mfc\afximpl.h(635) : error C2238: unexpected token(s) preceding ';'

解决方法:
找到 stdafx.h, 修改如下

#ifndef WINVER
#if _MSC_VER>=1500          // 1500 == Visual Studio 2008
#define WINVER 0x0501       // 0501 == Windows XP and Windows .NET Server
#else
#define WINVER 0x0400  // 0x0400 == Windows 98 and Windows NT 4.0 (because of '_WIN32_WINDOWS=0x0410')
#endif
#endif

#ifndef _WIN32_WINNT
#if _MSC_VER>=1500              // 1500 == Visual Studio 2008
#define _WIN32_WINNT 0x0501  // 0501 == Windows XP
#else
#define _WIN32_WINNT 0x0400  // 0x0400 == Windows NT 4.0
#endif
#endif

2.
error C2011: 'tagMENUINFO' : 'struct' type redefinition

解决方法如下:
找到 .\src\UILayer\TitleMenu.h 修改如下

3.
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\..\src\mfc\afximpl.h(54) : 参见“AUX_DATA”的声明

解决方法如下:
AUX_DATA中已不再包含成员bWin95

#if _MSC_VER>=1500          // 1500 == Visual Studio 2008
lf.lfQuality = ANTIALIASED_QUALITY;
#else
lf.lfQuality = afxData.bWin95 ? NONANTIALIASED_QUALITY : ANTIALIASED_QUALITY;
#endif

大约有10 处

4.
.\WorkLayer\FtpClientReqSocket.cpp(51) : error C2440: “初始化”: 无法从“const char *”转换为“char *”

解决方法如下:
 char *p=(char*)strstr(pData,"\r\n");

5.
.\Emule.cpp(18) : warning C4603: “_CRTDBG_MAP_ALLOC”: 未定义宏或在预编译头使用后定义发生改变
        将宏添加到预编译头中,而不是在此处定义
        .\Emule.cpp(21) : 使用预编译头
.\Emule.cpp(294) : fatal error C1189: #error :  "You are using an MFC version which may require a special version of the above function!"

解决方法如下:
// Workaround for buggy 'AfxSocketTerm' (needed at least for MFC 7.0)
#if _MFC_VER==0x0700 || _MFC_VER==0x0710 || _MFC_VER==0x0800 || _MFC_VER==0x0900

 


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理