Skip to content

Incorrect build instructions on Windows #1701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,44 @@ make sure those are installed on your system.

## Compiling on Windows/Visual Studio

The following steps should be called from the VS developer command prompt.

1. Generate the VS solution

```shell
cd <CppSharp>\build
./build.sh generate -configuration Release -platform x64
<sh> build.sh generate -configuration Release -platform x64
```

2. Compile the VS projects

You can open `CppSharp.sln` and hit F5 or compile via the command line:

```
./build.sh -configuration Release -platform x64
<sh> build.sh -configuration Release -platform x64
```

Building in *Release* is recommended because else we will use the Clang parser
debug configuration, which will be too slow for practical use beyond debugging.

The solution generated will be for Visual Studio 2019.

If you have a more recent version of Visual Studio, you can either:
- install Visual Studio 2019
- install Visual Studio 2019 build tools, from [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/)
- select the payload *MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.29-16.11)*

Please note that Windows isn't natively able to run sh scripts, to remediate this, you can either:

- use the one from Visual Studio if present
- e.g. `C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\usr\bin\sh.exe`
- use the one from [Git for Windows](https://gitforwindows.org/)
- e.g. `C:\Program Files\Git\bin\sh.exe`

When opening the solution for the first time on a more recent version than Visual Studio 2019, you will be prompted to retarget projects to one of the platform toolset available on your system.

## Compiling on macOS or Linux

The following steps should be called from the VS developer command prompt.

1. Generate the VS solution and makefiles

Expand Down