1How to build aMule with Visual Studio 2010 Express Edition
2
3See also http://www.amule.org/wiki/index.php/HowTo_compile_with_Visual_Studio
4
5This solution for Microsoft's Visual Studio 2010 has been configured to be as easy as possible to set up. 
6
7However, given the size of the aMule project and the libraries it uses, along with limitations in the way Visual Studio works,
8a couple of items must be setup separately. Additionally, some source code files might need patching due to incompatibilities 
9with some generated files. 
10
11The solution expects to find the following items:
12
13* wxWidgets ( http://www.wxwidgets.org ) at a specific location: ..\..\wxWidgets\ from the solution directory.
14* crypto++ ( http://www.cryptopp.com/ ) at a specific location: ..\..\cryptopp\ from the solution directory.
15
16
17This means you must create a folder where you will compile aMule, and it must have this structure:
18
19- <Root folder> - Your main folder. You can name it whatever you want.
20 | 
21 | - wxWidgets ( wxWidgets sources, no intermediate subfolder )
22 |
23 | - wxWidgets29 ( wxWidgets 2.9 sources, only required if you want to build against unstable wx 2.9 )
24 |
25 | - cryptopp ( Crypto++ sources, no intermediate subfolder )
26 |
27 | - <amule-sources> ( aMule sources, no intermediate subfolder, can have any name )
28
29
30I hope this is simple enough to get you started. 
31
32If wxWidgets fails to compile, please read http://wiki.wxwidgets.org/Microsoft_Visual_CPP_Guide
33
34There is sometimes a problem with the cryptopp project in the release and debug build, if some projects fail to link
35and give you a warning about redefined symbols, go to the properties on the cryptopp project, configuration "release" and change
36the "Configuration Properties"->"C/C++"->"Code generation"->"Runtime library" to "Multithreaded DLL (/MD)"
37 in the release build or "Multithreaded Debug DLL (/MDd)" for the debug build. 
38
39There are 3 solutions:
401) aMule-MSVC10E.sln
41   which includes aMule, aMule tools and aMule's internal libs
422) aMule-MSVC10E-ExtLibs.sln
43   includes only wxWidgets and Crypto++ and builds a single library libext.lib from them. You must first build this solution before building aMule-MSVCE.sln
443) aMule-MSVC10E-ExtLibs29.sln
45   same but using wxWidgets 2.9
46
47
48The Debug/Release configs build against wxWidgets 2.8 (stable), Debug29/Release29 configs build against wxWidgets 2.9 (unstable)
49
50To build aMule with GeoIP see libs\libGeoIP\readme.txt . 
51Without it you get an error building libGeoIP when you build the full solution.
52Just ignore it or unload the libGeoIP project.
53
54
55If aMule fails to compile, here are some guidelines/patches to the most common problems:
56
57[*] If Scanner.cpp fails to compile, apply this change around line 1545:
58
59-        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
60+        b->yy_is_interactive = 0;
61
62if necessary.
63
64[*] The file muuli_wdr.cpp can also fail if it hasn't been patched for MSVC in the current code. The most common problem comes 
65from this kind of lines:
66
67        _("For a film you can say its length, its story, language ...\n"
68          "and if it's a fake, you can tell that to other users of aMule."),
69
70Notice the opening and closing parentheses are on a different line, and the quotes opened again. While this is ok for gcc, Visual
71Studio won't allow it. Change this lines to be a single-line quoted text. In the above example, the result will be:
72
73	_("For a film you can say its length, its story, language ...\nand if it's a fake, you can tell that to other users of aMule."),
74
75And that should be it. Feel free to ask in the aMule forum at forum.amule.org, "Compilation problems" section if you have further
76doubts.
77
78If you want to run aMule from inside Visual Studio, always set
79_NO_DEBUG_HEAP=1
80in Properties / Debugging / Environment!
81