質問するログイン新規登録

回答編集履歴

3

LNK1158

2017/06/13 04:38

投稿

YouheiSakurai
YouheiSakurai

スコア6155

answer CHANGED
@@ -16,6 +16,8 @@
16
16
  ![Visual C++ Build Tools.png](99f0e437c172cf7e11d5e1d2636fac63.png)
17
17
  ![Visual C++ Build Tools Overview.png](a1f096715ea1c1b925be01e3460330c6.png)
18
18
 
19
+ 【追記】この時に環境にあったWindows SDKをインストールしないとLNK1158でビルドに失敗することがある。
20
+
19
21
  5. こんな感じにインストールされるのを待つ。
20
22
  ![BuildTools](2ab5e0584dc95d077b7b1626c188343c.png)
21
23
 

2

テストコマンドの編集

2017/06/13 04:38

投稿

YouheiSakurai
YouheiSakurai

スコア6155

answer CHANGED
@@ -19,18 +19,8 @@
19
19
  5. こんな感じにインストールされるのを待つ。
20
20
  ![BuildTools](2ab5e0584dc95d077b7b1626c188343c.png)
21
21
 
22
- 6. 以下のようにテストコマンドを実行して各テストをスすることを確認する。
22
+ 6. 以下のようコマンドを実行してPythonがコンイラを認識できることを確認する。
23
23
 
24
24
  ```
25
- C:\Users\sakurai>python -m distutils.tests.test_msvccompiler
26
- test_compiler_options (__main__.msvccompilerTestCase) ... ok
25
+ python -c "from distutils.ccompiler import new_compiler; compiler = new_compiler(); compiler.initialize(); print(compiler.cc)"
27
- test_get_vc_env_unicode (__main__.msvccompilerTestCase) ... ok
28
- test_no_compiler (__main__.msvccompilerTestCase) ... ok
29
- test_vcruntime_copy (__main__.msvccompilerTestCase) ... ok
30
- test_vcruntime_skip_copy (__main__.msvccompilerTestCase) ... ok
31
-
32
- ----------------------------------------------------------------------
33
- Ran 5 tests in 6.051s
34
-
35
- OK
36
26
  ```

1

Visual C\+\+ Build Toolsのインストール方法

2017/05/18 08:32

投稿

YouheiSakurai
YouheiSakurai

スコア6155

answer CHANGED
@@ -1,3 +1,36 @@
1
1
  Anacondaは使ったことがないのでよく分からないですが、Python 3.6なら以下を入れましょう。
2
2
 
3
- https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.0_standalone:_Build_Tools_for_Visual_Studio_2017_.28x86.2C_x64.2C_ARM.2C_ARM64.29
3
+ https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.0_standalone:_Build_Tools_for_Visual_Studio_2017_.28x86.2C_x64.2C_ARM.2C_ARM64.29
4
+
5
+ **~ 以下、追記 / Visual C++ Build Toolsのインストール方法 ~**
6
+
7
+ 1. ブラウザで「https://www.visualstudio.com/ja/downloads/」を開く。
8
+
9
+ 2. 「Build Tools for Visual Studio 2017」右側のダウンロードをクリックする。
10
+ ![Build Tools for Visual Studio 2017.PNG](bca255320c576dc3e6217c984b7839a2.png)
11
+
12
+ 3. ファイル名が「vs_buildtools」から始まることを確認してダウンロードして実行する。
13
+ ![vs_buildtools__35187572.1495092537.exe.png](c0d41623f826951bd699f6837d41bfd1.png)
14
+
15
+ 4. ウィザードの途中で「Visual C++ Build Tools」を選択してインストールを開始する。
16
+ ![Visual C++ Build Tools.png](99f0e437c172cf7e11d5e1d2636fac63.png)
17
+ ![Visual C++ Build Tools Overview.png](a1f096715ea1c1b925be01e3460330c6.png)
18
+
19
+ 5. こんな感じにインストールされるのを待つ。
20
+ ![BuildTools](2ab5e0584dc95d077b7b1626c188343c.png)
21
+
22
+ 6. 以下のようにテストコマンドを実行して各テストをパスすることを確認する。
23
+
24
+ ```
25
+ C:\Users\sakurai>python -m distutils.tests.test_msvccompiler
26
+ test_compiler_options (__main__.msvccompilerTestCase) ... ok
27
+ test_get_vc_env_unicode (__main__.msvccompilerTestCase) ... ok
28
+ test_no_compiler (__main__.msvccompilerTestCase) ... ok
29
+ test_vcruntime_copy (__main__.msvccompilerTestCase) ... ok
30
+ test_vcruntime_skip_copy (__main__.msvccompilerTestCase) ... ok
31
+
32
+ ----------------------------------------------------------------------
33
+ Ran 5 tests in 6.051s
34
+
35
+ OK
36
+ ```