Official eMule-Board: Tutorial: Compile Emule 0.50A Under Windows Xp And Visual Studio 2003 - Official eMule-Board

Jump to content


Page 1 of 1

Tutorial: Compile Emule 0.50A Under Windows Xp And Visual Studio 2003

#1 User is offline   126 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 25-September 10

Post icon  Posted 29 April 2016 - 12:45 PM

Posted Image « YouTube: Compile eMule 0.50a Under Windows XP and Visual Studio 2003 »



This video shows the exact whole process of compiling eMule 0.50a, which will also help us understand Visual C++ a little better, such as simple Linker options such as /NODEFAULTLIB:msvcrtd.

Before this video, I made others that demonstrate how to install Visual Studio 2003 and the required SDKs and also IIS (from the Windows XP install disc).

Then I will post those other videos here to make it clearer.

But this one is the most concise and direct video as it shows the actual compiler/linker configuration and compilation process, so I put it at the beginning so that you can see what you will learn after studying it. Basically, we will learn to generate an emule.exe file by ourselves and that will have to be stored in its own portable subdirectory, ready to download files through the eD2k and Kad (Kademlia) network.

In other words, at the end we will learn to get our own Portable eMule.




Sample EXE (put it in its own directory since it will generate a lot of configuration files and directories):
Posted Image https://archive.org/...ule_RELEASE.exe
Posted Image https://archive.org/...emule_DEBUG.exe

Full source code:
https://archive.org/...ources-FULL.zip

Source code and separated libraries:
https://archive.org/...50a-Sources.zip
https://archive.org/...project.net.zip



Necessary Tools and Libraries/SDKs


Visual Studio 2003


Windows Media Format 9 SDK (WMFormatSDK.exe):
https://archive.org/...WMFormatSDK.exe

Speech Application SDK 1.1 (SASDK_V11_Full.exe):
https://archive.org/...DK_V11_Full.exe

Windows 7 and .NET 3.5 SDK (GRMSDK_EN_DVD.iso):
https://www.microsof...s.aspx?id=18950




Getting to Download Files with eMule


eMule is a good addition to torrent resources. We simply need to have a list of good servers handy. Those servers need to contain millions of different and valid files, and we always need to connect both to eD2k and Kad to greatly increase the content we will find. Don't discriminate servers with just thousand or hundreds of files because they could contain important and unique files, but prioritize those with a massive number of files.

As a minimum, we just need to load the server list from http://peerates.net/servers.php (the process of loading servers from an URL like this is shown near the end of the video).

This is the file server.met that I normally use:
server.met
server.met


Or simply copy this file to the directory config which is generated by eMule when it's first run, then we need to close/terminate the eMule process, we need to reopen/re-run eMule, and we will have our server list laded.

This post has been edited by 126: 30 April 2016 - 07:25 AM

3

#2 User is offline   126 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 25-September 10

Post icon  Posted 30 April 2016 - 06:51 AM

Posted Image « YouTube: Compile eMule 0.50a as a Release Version Under Windows XP and Visual Studio 2003 »


In this video I show how to compile a Release version instead of a Debug one.

This is necessary since the Debug version is a little bit unstable under Windows 7, but the Release version runs exactly the same as the binary we can download from the official eMule website.

Minute 1:25 shows how to get into the root Project Properties and then to the Configuration Properties. Then, we change the Configuration options, from Debug to Release, for all of the project components.

Minute 1:11:28 shows the command line options that the Linker should have to not generate compile errors due to multiple references of the included library functions from LIB files (we always need to exclude with /NODEFAULTLIB:msvcrt.lib and /NODEFAULTLIB:msvcrtd.lib).

This post has been edited by 126: 30 April 2016 - 07:14 AM

2

#3 User is offline   126 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 25-September 10

Posted 04 May 2016 - 12:06 PM

Installing the Development Environment

By default, we will use VirtualBox to create a discardable development environment. We need to create a 40-Gigabyte disk image. Then we need to install Windows XP SP3. We need as a minimum 2 cores and 1024 Megabytes of RAM for the emulation. We need to disable mostly the Themes and Windows Update services so that everything executes considerably faster.

Once we have finished our development effort, we can format or erase the disk image to free up space, develop another project or make a clean install of Windows XP again to have a simple and efficient environment from which we can work with any source code and project.

Anyway, here is the whole installation, configuration and compilation sequence, so it won't be difficult for us in any way to repeat the process again when we want.


First, we must be able to exchange files between our real Operating System (ReactOS) and the one we are emulating inside VirtualBox. In this way we will be able to pass back and forth installers and source code, and get back the binaries and executables we generate:
Posted Image « Share Files Between our Real Operating System and VirtualBox »


Visual Studio 2003 is the tool used to compile eMule 0.50a in particular:
Posted Image « Installl Visual Studio 2003 in VirtualBox with Windows XP SP3 »


Presumably this library is used to get and show multimedia metadata for the downloaded files:
Posted Image « Install Windows Media Format SDK 9 under Windows XP (WMFSDK9) »


Concerning SAPI (Speech API), we need to study the eMule code deeply to find out which function it has, since it doesn't seem to use voice synthesization ecesitamos estudiar a profundidad el código para averiguar qué función tiene en eMule, ya que este no parece tener sintetización de voz a la vista:
Posted Image « Windows XP: Install IIS and Microsoft Speech Application Software Development Kit 1.1 (Speech API SDK) »


eMule 0.50a was developed after Windows 7. eMule 0.50a was released April 7 2010, and Windows 7 was released October 22 2009. So, the source code contains dependencies that make reference to Windows 7 so we will have to download the "Windows 7 and .NET 3.5 SDK". Otherwise, the compilation will fail without the development files of that SDK, which are referenced. It mostly makes reference to dialogs and functions for minimizing to the system tray, which are specific to Windows 7:
Posted Image « Install Windows 7 and .NET 3.5 SDK »

This post has been edited by 126: 04 May 2016 - 12:07 PM

2

#4 User is offline   dadsa 

  • Member
  • PipPip
  • Group: Members
  • Posts: 16
  • Joined: 13-March 16

Posted 30 September 2017 - 05:57 PM

Output Window

Compiling...
stdafx.cpp
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(142) : warning C4616: #pragma warning : warning number '6059' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(267) : warning C4616: #pragma warning : warning number '6059' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\wchar.h(1224) : warning C4616: #pragma warning : warning number '6386' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\wchar.h(1233) : warning C4616: #pragma warning : warning number '6386' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\wchar.h(1242) : warning C4616: #pragma warning : warning number '6386' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\wchar.h(1243) : warning C4616: #pragma warning : warning number '6387' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\wchar.h(1253) : warning C4616: #pragma warning : warning number '6386' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\tchar.h(756) : warning C4616: #pragma warning : warning number '6054' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\tchar.h(777) : warning C4616: #pragma warning : warning number '6054' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\tchar.h(777) : warning C4616: #pragma warning : warning number '6059' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(259) : warning C4616: #pragma warning : warning number '6530' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(773) : warning C4616: #pragma warning : warning number '6540' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\malloc.h(202) : warning C4616: #pragma warning : warning number '6540' out of range, must be between '4001' and '4999'
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdbg.h(1162) : warning C4615: #pragma warning : unknown user warning type
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdbg.h(1172) : warning C4615: #pragma warning : unknown user warning type
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(629) : warning C4996: '_wcsupr' was declared deprecated
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(311) : see declaration of '_wcsupr'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(634) : warning C4996: '_wcslwr' was declared deprecated
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(305) : see declaration of '_wcslwr'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(649) : warning C4996: 'vswprintf' was declared deprecated
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\swprintf.inl(97) : see declaration of 'vswprintf'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(349) : warning C4996: '_localtime64' was declared deprecated
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.h(212) : see declaration of '_localtime64'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(363) : warning C4996: '_gmtime64' was declared deprecated
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.h(209) : see declaration of '_gmtime64'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\ATLComTime.h(118) : error C2535: 'ATL::COleDateTime::COleDateTime(time_t) throw()' : member function already defined or declared
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\ATLComTime.h(114) : see declaration of 'ATL::COleDateTime::COleDateTime'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\ATLComTime.h(176) : error C2535: 'ATL::COleDateTime &ATL::COleDateTime::operator =(const time_t &) throw()' : member function already defined or declared
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\ATLComTime.h(172) : see declaration of 'ATL::COleDateTime::operator`=''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\mfc\afximpl.h(361) : warning C4005: '_countof' : macro redefinition
c:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(362) : see previous definition of '_countof'
Results

Build log was saved at "file://c:\Documents and Settings\Ffd\Desktop\eMule0.50a-Sources-FULL\srchybrid\Debug\BuildLog.htm"
emule - 2 error(s), 21 warning(s)
0

#5 User is offline   126 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 25-September 10

Posted 24 October 2017 - 11:17 PM

It could probably work if the directory references for ATLMFC are removed from Visual studio, write them down somewhere else, and retry.

You should also use the /NODEFAULTLIB:msvcrt.lib and /NODEFAULTLIB:msvcrtd.lib command line options in the Preferences dialog (right click) for the project as compilation would fail due to function references if those switches aren't used.

This post has been edited by 126: 24 October 2017 - 11:35 PM

0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users