Content-Length: 653907 | pFad | https://github.com/googleapis/google-cloud-cpp/pull/178

07 Get the code to compile with Microsoft Visual Studio 2017. by coryan · Pull Request #178 · googleapis/google-cloud-cpp · GitHub
Skip to content

Get the code to compile with Microsoft Visual Studio 2017. #178

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 8 commits into from
Jan 15, 2018

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Jan 12, 2018

These changes fix the compilation problems on Windows (actually tested with MSVC 2017, but should, work with others), they unblock @paprat so he can continue working on #23. They also fix #100.

Incidentally this fixes googleapis#100.  Lots of warnings in Abseil
and Protobuf code that I am chosing not to silence.
I forgot that we had an embedded grpc::Status() which does not
have noexcept moves.
@coryan coryan requested review from mbrukman and paprat January 12, 2018 15:27
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 12, 2018
#if __cplusplus < 201103L
#error "Bigtable C++ Client requires C++11"
#endif // __cplusplus < 201103L
#elif _MSC_VER < 1700
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not wrong default and delete functions are not supported by _MSC_VER 1700 according to this. And I think we need this feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Check for 1900.

Copy link
Contributor

@paprat paprat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor comment.

Thanks to @paprat for pointing out that key C++11 features are
missing in MSVC 2013 (aka 17.00)
@coryan
Copy link
Contributor Author

coryan commented Jan 12, 2018

PTAL.

automake \
build-essential \
clang \
... # More stuff ommitted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ommitted/omitted/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


## Windows

If you mainly use Windows as your development environment you need to install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/environment you/environment, you/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

in a `cmd.exe` shell, running as the `Administrator`:

```commandline
c:> @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use C:\> as the prompt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


### Creating a Windows VM using Google Compute Engine

If you do not have a Windows workstation but need a Windows development
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/workstation but/workstation, but/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

### Creating a Windows VM using Google Compute Engine

If you do not have a Windows workstation but need a Windows development
environment to troubleshoot a test or build problem it might be convenient to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/problem it/problem, it/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

The previous installation should create a
`Developer Command Prompt for VS 2017` entry in your "Windows" menu, use that
entry to create a new shell.
In that shell install `vcpkg` the Microsoft supported ports for many Open Source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/shell install/shell, install/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

The previous installation should create a
`Developer Command Prompt for VS 2017` entry in your "Windows" menu, use that
entry to create a new shell.
In that shell install `vcpkg` the Microsoft supported ports for many Open Source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] vcpkg, the Microsoft-supported [...]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

## Windows

If you mainly use Windows as your development environment you need to install
a number of tools. We use [chocolatey](https://www.chocolatey.com) to drive the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/chocolatey/Chocolatey/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


Then you can install the dependencies in the same shell:
```commandline
c:> choco install -y cmake git cmake.portable activeperl ninja golang yasm putty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. we should probably upper-case the prompt as it's typically C: not c:
  2. the prompt is typically C:\> but I see you're probably not including the path, because it changes (you have some cd commands below — I typically pattern-match on C:\> so it was a bit confusing to see c:> as the prompt, as I don't think I've ever seen that version in my use of Windows or DOS
  3. do you want to use C:\...> as the prompt to avoid updating the path? Or maybe just >?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going with option 3.

c:> puttygen
```

Then store the key in your [GitHub Settings](https://github.com/settings/keys),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two steps in this one line, so they should be split up into separate sentences for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

@mbrukman mbrukman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We can [skip ci] for this.
@coryan coryan merged commit ceae0a8 into googleapis:master Jan 15, 2018
@coryan coryan deleted the compile-on-windows branch January 15, 2018 16:28
@@ -14,6 +14,15 @@

#include "bigtable/client/client_options.h"

#include <cstdlib>
#ifdef WIN32

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere - _WIN32 is preferable (leading underscore variant) versus WIN32.

using your favorite RDP client. For example the
[chrome extension](https://chrome.google.com/webstore/detail/chrome-rdp-for-google-clo/mpbbnannobiobpnfblimoapbephgifkm/)

### Connecting to GitHub with PuTTY

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW Windows 10 ships a real OpenSSH client (and server) now. I suspect that will rather quickly become a dominant SSH client for Windows developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a small wrapper for setenv() for portability to Windows
5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/google-cloud-cpp/pull/178

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy