Difference between revisions of "HowTo compile with Visual Studio"

From AMule Project FAQ
Jump to: navigation, search
(created)
 
(removed zlib, added fixes for settings)
Line 8: Line 8:
 
*Windows port of [[wxWidgets]] library (knows as [[wxWidgets|wxMSW]]) -> [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.7.zip Download (2.8.7)]
 
*Windows port of [[wxWidgets]] library (knows as [[wxWidgets|wxMSW]]) -> [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.7.zip Download (2.8.7)]
 
* [http://www.cryptopp.com/ Crypto++] library -> [http://prdownloads.sourceforge.net/cryptopp/cryptopp552.zip Download(5.5.2)]
 
* [http://www.cryptopp.com/ Crypto++] library -> [http://prdownloads.sourceforge.net/cryptopp/cryptopp552.zip Download(5.5.2)]
*[http://www.zlib.org zlib] compression library -> [http://www.zlib.net/zlib-1.2.3.tar.gz Download (1.2.3)]
+
*[http://www.zlib.org zlib] compression library is already included in wxMSW
 
*aMule's latest [[aMule CVS|source tarball]] (2.1.3 will not work) -> [http://www.hirnriss.net/?area=cvs Download aMule]
 
*aMule's latest [[aMule CVS|source tarball]] (2.1.3 will not work) -> [http://www.hirnriss.net/?area=cvs Download aMule]
  
Line 20: Line 20:
 
*Unpack wxMSW to "aMule\wxWidgets" (no intermediate subfolder).
 
*Unpack wxMSW to "aMule\wxWidgets" (no intermediate subfolder).
 
*Unpack cryptopp to "aMule\cryptopp" (no intermediate subfolder).
 
*Unpack cryptopp to "aMule\cryptopp" (no intermediate subfolder).
*Unpack zLib to "aMule\zlib" (no intermediate subfolder).
 
 
*Unpack aMule to "aMule\trunk" (no intermediate subfolder). This folder can be named as you like, the 3 library folders must have exact the names from above, or the project won't load.
 
*Unpack aMule to "aMule\trunk" (no intermediate subfolder). This folder can be named as you like, the 3 library folders must have exact the names from above, or the project won't load.
  
Line 26: Line 25:
  
 
*Open "aMule\wxWidgets\build\msw\wx.dsw" in VS. It asks, if it should convert the project. Answer "Yes to all".
 
*Open "aMule\wxWidgets\build\msw\wx.dsw" in VS. It asks, if it should convert the project. Answer "Yes to all".
*Close VS, saving the changes.
 
*Open "aMule\zlib\projects\visualc6\zlib.dsw" in VS. It asks, if it should convert the project. Answer "Yes to all".
 
 
*Close VS, saving the changes.
 
*Close VS, saving the changes.
  
Line 37: Line 34:
 
*In ''Configuration Properties/C-C++/Code Generation'' change ''Runtime Library'' to ''Multithreaded Debug DLL (/MDd)'' for the debug build or to ''Multithreaded DLL (/MD)'' for the release build.
 
*In ''Configuration Properties/C-C++/Code Generation'' change ''Runtime Library'' to ''Multithreaded Debug DLL (/MDd)'' for the debug build or to ''Multithreaded DLL (/MD)'' for the release build.
 
*Right-click on ''external libraries'' and select ''build''.
 
*Right-click on ''external libraries'' and select ''build''.
 +
 +
== Fixing aMule project settings ==
 +
 +
In ''Configuration Properties/C-C++/General/Additional Include Directories'' replace ''$(SolutionDir)\..\..\zlib\'' by
 +
''$(SolutionDir)\..\..\wxwidgets\src\zlib'' for projects aMule, aMuleGui libmuleec.
 +
 +
In aMule ''Configuration Properties/Linker/Input/Additional Dependencies'' add ''shlwapi.lib''.
  
 
== Compiling aMule ==
 
== Compiling aMule ==
Line 70: Line 74:
  
 
== Version ==
 
== Version ==
Created by Sturedman on 21.05.08 at 23:10<br>
+
Created by Sturedman on 21.05.08 at 23:10<br>Last update [[User:Sturedman|Sturedman]] 23:21, 30 May 2008 (CEST)

Revision as of 22:21, 30 May 2008

English | German

Requirements for compiling aMule for Windows using Visual Studio

You will need the following packages:

Also, 1100MB free space on your hard disk (around 40MB to download the above packages and the rest for temporary compilation files and installations. The amount of space needed will largely depend on the configuration flags you use).

As a reference, the whole compilation process will take around 20 min on a medium-high resourced computer.

Unpacking the sources

  • Create a root folder. You can name it whatever you want. In this example it is called "aMule".
  • Unpack wxMSW to "aMule\wxWidgets" (no intermediate subfolder).
  • Unpack cryptopp to "aMule\cryptopp" (no intermediate subfolder).
  • Unpack aMule to "aMule\trunk" (no intermediate subfolder). This folder can be named as you like, the 3 library folders must have exact the names from above, or the project won't load.

Preparing the library projects

  • Open "aMule\wxWidgets\build\msw\wx.dsw" in VS. It asks, if it should convert the project. Answer "Yes to all".
  • Close VS, saving the changes.

Compiling the libraries

  • Open the aMule solution "aMule\trunk\MSVC Solution\aMule-MSVC.sln" in VS (VS 2008 will again ask to convert it)
  • In the toolbar set the Solution Configuration to Debug or Release (whatever you prefer) and the Solution Platform to Win32.
  • In the solution explorer open properties of external libraries/cryptlib.
  • In Configuration Properties/C-C++/Code Generation change Runtime Library to Multithreaded Debug DLL (/MDd) for the debug build or to Multithreaded DLL (/MD) for the release build.
  • Right-click on external libraries and select build.

Fixing aMule project settings

In Configuration Properties/C-C++/General/Additional Include Directories replace $(SolutionDir)\..\..\zlib\ by $(SolutionDir)\..\..\wxwidgets\src\zlib for projects aMule, aMuleGui libmuleec.

In aMule Configuration Properties/Linker/Input/Additional Dependencies add shlwapi.lib.

Compiling aMule

If you aren't interested in Unit Tests (or don't know what it's about) remove the UnitTests tree from the solution.

Now hit F7 and lean back.

If you get errors:

error in Scanner.cpp

change

b->yy_is_interactive = 0;
// b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;

'GetTickCount64' : redefinition

This happens on Vista with VS 2008. To fix it, open "GetTickCount.h" and insert

#define GetTickCount64 GetTickCount_64
uint64 GetTickCount64();

Running

To run aMule from VS, right-click on Monolithic build/aMule and Set as StartUp project. Then hit F5.

To run aMule on a machine with no VS installed you have to install the Visual Studio Runtime.

aMule's configuration will be stored in your document folder in "AppData\Roaming\aMule" (under Vista).

Version

Created by Sturedman on 21.05.08 at 23:10
Last update Sturedman 23:21, 30 May 2008 (CEST)