-
-
Notifications
You must be signed in to change notification settings - Fork 8
How To Compile the MT API .NET project
Here are the instructions to compile this whole project for MT4 on a Win8.1 & VS 2017
.
A copy of these are better maintained in the COMPILE.md
file of the mtapi project.
First things first. make sure you have cloned the latest version of this repo.
-
Note
: ❗
Here I use a shallow clone, because I am not yet interested in making dev changes, just build the project.
If you need to do dev and make PR's, you have to use a normal/full clone.
# cd D:\myDev\_gh_cloned\
#git clone --depth=1 --no-tags [email protected]:vdemydiuk/mtapi.git # ssh -- better
git clone --depth=1 --no-tags https://github.com/vdemydiuk/mtapi.git # http --faster
cd mtapi
Next Prepare yourself for Visual Studio 2019
(from now on just "VS"). (But here I use 2017.) You need to install a bunch, and I mean a lot of, yes too many, dependencies. Otherwise you will run into all sorts of weird stuff. So if you're new to VS, just make sure you have the latest updated version.
Click for a Surprise!
- Install
Visual Studio 2019
from here. - Install the WIX stuff from above ...
- Install the 2 .NET Framework's:
.NET 4.8
,.NET 4.7.2
and.NET Core
(5.0) from here:
Click Me!
- Fire up the
Visual Studio Installer
and install the following items:
Click Me!
- Also make sure you install the
C++/CLI
package.
More interestingly you may also try to just import all the requirements I had, by clicking "Import Configuration"
in the drop-down (as shown in the screenshot below). Save the following text/code into a file called .vsconf
and import it.
Click Me!
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"microsoft.net.componentgroup.targetingpacks.common",
"microsoft.componentgroup.blend",
"microsoft.visualstudio.component.entityframework",
"microsoft.visualstudio.component.diagnostictools",
"microsoft.visualstudio.component.debugger.justintime",
"microsoft.net.componentgroup.4.7.2.developertools",
"microsoft.visualstudio.component.vc.diagnostictools",
"microsoft.visualstudio.component.vc.cmake.project",
"microsoft.visualstudio.component.vc.atl",
"microsoft.visualstudio.component.vc.testadapterforboosttest",
"microsoft.visualstudio.component.vc.testadapterforgoogletest",
"microsoft.visualstudio.componentgroup.nativedesktop.win81",
"microsoft.visualstudio.component.vc.cli.support",
"microsoft.component.netfx.native",
"microsoft.visualstudio.component.windows10sdk",
"component.wixtoolset.visualstudioextension.dev15",
"component.wixtoolset.visualstudioextension.schemas3",
"component.wixtoolset.visualstudioextension.schemas4"
]
}
- Fire up
Visual Studio
and open the cloned project repo (mtapi
), by clicking:
-
[File] > Open > Project/Solution
(or just typeCTRL-SHIFT-o
) - Navigate to the path of your repo. For example:
D:\myDev\_gh_cloned\mtapi\
- Select the solution file, named:
MetaTraderApi_2017.sln
.
(Note that VS projects are also called solutions and have the file extension*.sln
.)
Click Me!
- Now the project is imported, you need to adjust a few things:
-
Retarget the project to use
Win8.1
instead ofWin10
, if needed. - Change to use
32-bit
builds (for MT4) by default, as shown on top bar of VS. - Select a Startup Project. Set to use:
TestApiClientUI
, also shown on top bar of VS. - Select what to build in the
Configuration Manager...
.
Click Me!
- You are now ready to Build the project!
Select:Solution 'MetaTraderApi_2017' (13 projects)
and hitF6
or click the Build Solution button.