如何在 Visual C++.NET 2003 下编译eMule
2006-08-22 23:16
369 查看
作者:loleeve
日期:2004-10-10
e-mail:loleeve@hotmail.com
编译环境:Microsoft Visual C++ .NET 2003 (v7.0)
eMule版本:0.44b
[1]下载源代码和支持库
1.下载eMule v0.44b 源代码
http://www.emule-project.com/
2.Crypto++ v5.1
http://www.eskimo.com/~weidai/cryptlib.html
3.zlib v1.2.1
http://www.gzip.org/zlib/
4.id3lib v3.8.3
http://sourceforge.net/projects/id3lib/
5.libpng
http://www.libpng.org/pub/png/libpng.html
或
http://sourceforge.net/projects/libpng/
6.ResizableLib 1.3
http://sourceforge.net/projects/resizablelib/
[2]编译eMule所需要的库。
注意:编译的所有库工程的Run-Time Libaray都统一用用Multi-threaded (/MT)
1.Crypto++ v5.1
对于VC++.NET 2003编译器,我们要对源代码做以下修改:
在文件integer.cpp中把
AllocatorBase<T>::pointer AlignedAllocator<T>::allocate(size_type n, const void *)
改为
CPP_TYPENAME AllocatorBase<T>::pointer AlignedAllocator<T>::allocate(size_type n, const void *)
在文件pubkey.h中把
template <class PK, class GP>
class DL_KeyImpl : public PK
{
public:
typedef GP GroupParameters;
OID GetAlgorithmID() const {return GetGroupParameters().GetAlgorithmID();}
改为
template <class PK, class GP, class O = OID>
class DL_KeyImpl : public PK
{
public:
typedef GP GroupParameters;
O GetAlgorithmID() const {return GetGroupParameters().GetAlgorithmID();}
然后编译Release版本,把生成的cryptlib.lib和头文件放到eMule下的crypto51。
2.ResizableLib 1.3
编译成Release Static版本,把ResizableLib.lib和头文件拷到eMule下的ResizableLib。
3.zlib v1.2.1
首先,打开zlib/Makefile.msc文件,把
CFLAGS = -nologo -MD -O2 $(LOC)
改为
CFLAGS = -nologo -MT -O2 $(LOC)
统一使用/MT 运行时库。
然后,在zlib/下运行nmake /a /f win32/Makefile.msc。(运行nmake前先运行VS.NET2003下vc7/bin/vcvars32.bat注册编译环境变量),把生成的zlib.lib和头文件放到eMule下的zlib。
4.libpng
进入png/projects/visualc6打开libpng工程,在libpng工程里添加之前生成的zlib头文件和库文件路径,编译成LIB ASM Release,然后把libpng.lib改名为png.lib,包括头文件一起拷到eMule下的png。
5.id3lib v3.8.3
解压id3lib v3.8.3,把config.h.win32改为config.h,然后进入解压后目录下的libprj并打开工程文件,去掉id3lib v3.8.3自带zlib库的头文件路径,添加之前编译好zlib库的头文件路径,编译Release版本。把生成的id3lib.lib和头文件拷到eMule下的id3。
6.CxImage 进入eMule/CxImage,打开工程文件,设置正确的png和zlib的库文件和头文件路径,然后编译Release版本,把生成的CxImage.lib拷到eMule/CxImage下。
[3]编译eMule
打开DialogMinTrayBtn.cpp把下面的
#if 0
// define this to use that source file as template
#define TEMPLATE template <class BASE>
#else
// define this to instantiate functions for class 'BASE' right in this CPP module
#define TEMPLATE
#define BASE CResizableDialog
#endif
改为
#if 0
// define this to use that source file as template
#define TEMPLATE template <class BASE>
#else
// define this to instantiate functions for class 'BASE' right in this CPP module
#define TEMPLATE template <>
#define BASE CResizableDialog
#endif
检查一下所需要的头文件目录和库文件是否正确,然后就可以编译Release版本的eMule了。如果所有eMule的支持库都用/MT编译的话,应该链接不会出什么问题,如果还是出现运行时库符号冲突,可以在链接参数里忽略某些运行时库。
官方的eMule编译通过了,接下来我们可以干嘛呢?如果你是牛人,又觉得现在的eMule不合自己口味,那你大可以修改它,但是如果你想发布你自己的eMule版本,别忘了把源代码也一起发布喔,因为eMule是受到GNU保护的。有点废话了,牛人又怎么会看这篇文章啦~~~~哈哈~~eMule的代码确实写得很优秀,是一个难得的学习机会。
日期:2004-10-10
e-mail:loleeve@hotmail.com
编译环境:Microsoft Visual C++ .NET 2003 (v7.0)
eMule版本:0.44b
[1]下载源代码和支持库
1.下载eMule v0.44b 源代码
http://www.emule-project.com/
2.Crypto++ v5.1
http://www.eskimo.com/~weidai/cryptlib.html
3.zlib v1.2.1
http://www.gzip.org/zlib/
4.id3lib v3.8.3
http://sourceforge.net/projects/id3lib/
5.libpng
http://www.libpng.org/pub/png/libpng.html
或
http://sourceforge.net/projects/libpng/
6.ResizableLib 1.3
http://sourceforge.net/projects/resizablelib/
[2]编译eMule所需要的库。
注意:编译的所有库工程的Run-Time Libaray都统一用用Multi-threaded (/MT)
1.Crypto++ v5.1
对于VC++.NET 2003编译器,我们要对源代码做以下修改:
在文件integer.cpp中把
AllocatorBase<T>::pointer AlignedAllocator<T>::allocate(size_type n, const void *)
改为
CPP_TYPENAME AllocatorBase<T>::pointer AlignedAllocator<T>::allocate(size_type n, const void *)
在文件pubkey.h中把
template <class PK, class GP>
class DL_KeyImpl : public PK
{
public:
typedef GP GroupParameters;
OID GetAlgorithmID() const {return GetGroupParameters().GetAlgorithmID();}
改为
template <class PK, class GP, class O = OID>
class DL_KeyImpl : public PK
{
public:
typedef GP GroupParameters;
O GetAlgorithmID() const {return GetGroupParameters().GetAlgorithmID();}
然后编译Release版本,把生成的cryptlib.lib和头文件放到eMule下的crypto51。
2.ResizableLib 1.3
编译成Release Static版本,把ResizableLib.lib和头文件拷到eMule下的ResizableLib。
3.zlib v1.2.1
首先,打开zlib/Makefile.msc文件,把
CFLAGS = -nologo -MD -O2 $(LOC)
改为
CFLAGS = -nologo -MT -O2 $(LOC)
统一使用/MT 运行时库。
然后,在zlib/下运行nmake /a /f win32/Makefile.msc。(运行nmake前先运行VS.NET2003下vc7/bin/vcvars32.bat注册编译环境变量),把生成的zlib.lib和头文件放到eMule下的zlib。
4.libpng
进入png/projects/visualc6打开libpng工程,在libpng工程里添加之前生成的zlib头文件和库文件路径,编译成LIB ASM Release,然后把libpng.lib改名为png.lib,包括头文件一起拷到eMule下的png。
5.id3lib v3.8.3
解压id3lib v3.8.3,把config.h.win32改为config.h,然后进入解压后目录下的libprj并打开工程文件,去掉id3lib v3.8.3自带zlib库的头文件路径,添加之前编译好zlib库的头文件路径,编译Release版本。把生成的id3lib.lib和头文件拷到eMule下的id3。
6.CxImage 进入eMule/CxImage,打开工程文件,设置正确的png和zlib的库文件和头文件路径,然后编译Release版本,把生成的CxImage.lib拷到eMule/CxImage下。
[3]编译eMule
打开DialogMinTrayBtn.cpp把下面的
#if 0
// define this to use that source file as template
#define TEMPLATE template <class BASE>
#else
// define this to instantiate functions for class 'BASE' right in this CPP module
#define TEMPLATE
#define BASE CResizableDialog
#endif
改为
#if 0
// define this to use that source file as template
#define TEMPLATE template <class BASE>
#else
// define this to instantiate functions for class 'BASE' right in this CPP module
#define TEMPLATE template <>
#define BASE CResizableDialog
#endif
检查一下所需要的头文件目录和库文件是否正确,然后就可以编译Release版本的eMule了。如果所有eMule的支持库都用/MT编译的话,应该链接不会出什么问题,如果还是出现运行时库符号冲突,可以在链接参数里忽略某些运行时库。
官方的eMule编译通过了,接下来我们可以干嘛呢?如果你是牛人,又觉得现在的eMule不合自己口味,那你大可以修改它,但是如果你想发布你自己的eMule版本,别忘了把源代码也一起发布喔,因为eMule是受到GNU保护的。有点废话了,牛人又怎么会看这篇文章啦~~~~哈哈~~eMule的代码确实写得很优秀,是一个难得的学习机会。
相关文章推荐
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- 如何在 Visual C++.NET 2003 下编译eMule
- visual c++.net 2003下如何自定义资源?!
- visual c++.net 技术内幕 第6版 附带的程序如何在vs2013中编译成功
- 如何在Visual Studio.NET 2003下编译ANTLR 2.77
- visual c++.net 技术内幕 第6版 附带的程序如何在vs2013中编译成功
- visual c++.net 技术内幕 第6版 附带的程序如何在vs2013中编译成功
- 在Visual C++.NET 2003中编译Log4cpp
- Visual C++ .NET 2003 常用快捷键简记
- WINX发布新版本,支持Visual C++ .NET 2003
- Visual C++.net 2003 与Matcom4.5混合编程
- (轉貼) 如何在Visusl Studio.NET 2003编译SystemC的Library? (C/C++) (SystemC) (VC++) (IC Design)
- WINX发布新版本,支持Visual C++ .NET 2003
- WINX发布新版本,支持Visual C++ .NET 2003
- 如何使 Activesync 能够从 Visual Studio .NET 2003 连接到模拟器会话?
- Microsoft Visual Studio .NET 2003 编译xvidcore-1.1.3
- 如何在在Visual C++ .NET 中將System::String* 转换为 Char*