-
Notifications
You must be signed in to change notification settings - Fork 14
Windows向けの環境構築ドキュメントを修正 #38
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
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
513e976
Windows Terminal のストアリンク更新
YuHima03 5c51b0e
スタンプ名だと分かりやすい表記に
YuHima03 617d1a1
拡張機能の名称を修正
YuHima03 e801873
リストの階層ミスを修正
YuHima03 58faa47
階層ごとに適切にインデントする
YuHima03 45e1a5b
表記修正
YuHima03 661a59c
settings.json にミスが無いか確認してもらう
YuHima03 6665090
MD整理
YuHima03 ba003dc
WSLインストール後にアカウント設定に進まない場合の対応を記載
YuHima03 fee747a
vscodeで制限モードになっている場合の対応を記載
YuHima03 4eb3af6
大文字小文字をミスってた
YuHima03 5d9f95f
code コマンドのパスが通っていない場合の対応を記載
YuHima03 f4ea757
Merge branch 'main' into fix/env-docs
YuHima03 31938bc
Merge branch 'traP-jp:main' into fix/env-docs
YuHima03 88f0385
フォーマットかかってた部分を戻す
YuHima03 41ad134
Ubuntuアカウント設定のtipを手順に組み込む
YuHima03 f5547be
settings.json にエラーがないか確認する手順を入れる
YuHima03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,36 +8,53 @@ next: {link: '/text/chapter-0/guidance', text: 講習会ガイダンス'} | |
|
|
||
| ## Step 1: Install WSL | ||
|
|
||
| 1. https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=ja-jp&gl=jp&icid=CNavAppsWindowsApps で Windows Terminal をインストール(既にインストールされていれば飛ばしてOKです) | ||
| 1. https://apps.microsoft.com/detail/9N0DX20HK701?hl=ja-jp&gl=JP&ocid=pdpshare で Windows Terminal をインストール(既にインストールされていれば飛ばしてOKです) | ||
|
|
||
| 1. アプリ検索の画面で、 `Terminal` と入力し 「管理者として実行」 | ||
|  | ||
|
|
||
|  | ||
|
|
||
|
|
||
| 2. `wsl --install -d Ubuntu` と入力して、エンターキーを押す。 | ||
|  | ||
|
|
||
|  | ||
|
|
||
| :::warning TA向け | ||
| WSL インストールトラブルシューティング | ||
| https://learn.microsoft.com/ja-jp/windows/wsl/troubleshooting | ||
| :::warning TA向け | ||
|
|
||
| `wsl --install` に失敗した際の手動インストールマニュアル | ||
| (Windowsバージョンの要件なども書いてあります) | ||
| https://learn.microsoft.com/ja-jp/windows/wsl/install-manual | ||
| ::: | ||
| WSL インストールトラブルシューティング | ||
| https://learn.microsoft.com/ja-jp/windows/wsl/troubleshooting | ||
|
|
||
| :::warning TA向け | ||
| 極稀に、BIOS で virtualization 設定が切られている為に WSL がインストールできない事があります(`Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.` と表示されます) | ||
| この場合は BIOS に入って、 Advanced -> Virtualization の順で有効化してください。 | ||
| ::: | ||
| `wsl --install` に失敗した際の手動インストールマニュアル | ||
| (Windowsバージョンの要件なども書いてあります) | ||
| https://learn.microsoft.com/ja-jp/windows/wsl/install-manual | ||
|
|
||
| ::: | ||
|
|
||
| :::warning TA向け | ||
|
|
||
| 極稀に、BIOS で virtualization 設定が切られている為に WSL がインストールできない事があります(`Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.` と表示されます) | ||
| この場合は BIOS に入って、 Advanced -> Virtualization の順で有効化してください。 | ||
|
|
||
| ::: | ||
|
|
||
| 3. Ubuntu のアカウント設定 | ||
| 1. `Enter new UNIX username:` が表示されるので、**半角英数小文字** でユーザーネームを入れる。( `take` とか `takemura` とか `ryugo` とか短い方が良い。フォルダの名前になります) | ||
| 2. `New Password:` WSL 内で使いたいパスワードを入力。何も表示されませんが入力されています。入力できたら エンターキーを押す。 | ||
| 3. `Retype New password:` もう一度入力。 | ||
|
|
||
|  | ||
| ::: tip | ||
|
|
||
| この時点でターミナルの下部に `Enter new UNIX username:` と表示されていない場合は、 `wsl -d Ubuntu` と入力してエンターを押してください。 | ||
|
|
||
| ここで「ディストリビューションが見つからない」という内容のエラーが表示される場合、1つ前の手順で失敗している可能性があります。 | ||
| ターミナルを開く部分からもう一度やり直してみてください。 | ||
|
|
||
| ::: | ||
|
|
||
| 1. `Enter new UNIX username:` が表示されるので、**半角英数小文字** でユーザーネームを入れる。( `take` とか `takemura` とか `ryugo` とか短い方が良い。フォルダの名前になります) | ||
|
|
||
| 2. `New Password:` WSL 内で使いたいパスワードを入力。何も表示されませんが入力されています。入力できたら エンターキーを押す。 | ||
|
|
||
| 3. `Retype New password:` もう一度入力。 | ||
|
|
||
|  | ||
|
|
||
|
Comment on lines
+51
to
42
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. どこでずれたか分かんないんだけど、 3-1, 3-2, 3-3 みたいな感じでここはインデント入れて入れ子にしておきたいので、ついでに直せるなら直してほしい…!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 4. ウィンドウを閉じる | ||
|
|
||
|
|
@@ -46,13 +63,14 @@ https://learn.microsoft.com/ja-jp/windows/wsl/install-manual | |
| 7. `Ctrl` + `,` で設定画面を開く | ||
|
|
||
| 8. 「規定のプロファイル」を「Ubuntu」に変更(複数あるならどれでも良い) | ||
|  | ||
|
|
||
|  | ||
|
|
||
| 9. 「保存」ボタンを押す | ||
|
|
||
| 10. Windows Terminal を閉じて、もう一度開く | ||
|
|
||
| 11. traQ の tasks チャンネルで :wsl: を押す | ||
| 11. traQ の tasks チャンネルで :wsl: スタンプを押す | ||
|
|
||
| ## Step 2: Install Clang | ||
|
|
||
|
|
@@ -70,84 +88,119 @@ https://learn.microsoft.com/ja-jp/windows/wsl/install-manual | |
| 2. 起動後、 `Ctrl` + `Shift` + `X` を押す | ||
|
|
||
| 3. `Japanese` と入力し、 `Japanese Language Pack for Visual Studio Code` をインストール。 | ||
|  | ||
|
|
||
|  | ||
|
|
||
| 4. VSCode の右下「Change Language and Restart」を押してインストール。 | ||
|
|
||
| 5. もう一度、 `Ctrl` + `Shift` + `X` を押す | ||
|
|
||
| 6. `WSL` を入力し、 `WSL` をインストール | ||
|  | ||
|
|
||
|  | ||
|
|
||
| 7. `Ctrl+,` を押して、出てきた画面に「Auto Save」と入力 | ||
|
|
||
| 8. 「Files: Auto Save」の項目を探して、「afterDelay」に変更する | ||
|  | ||
|
|
||
|  | ||
|
|
||
| 9. ターミナルで `code hello.txt` を入力し、VSCode が起動できたら成功! | ||
|  | ||
|
|
||
| 8. traQ の tasks チャンネルで :vscode: を押す | ||
|  | ||
|
|
||
| ::: tip | ||
|
|
||
| VSCode が起動しない場合は、一度ターミナルを閉じて開きなおしてからコマンドを再度実行してみてください。 | ||
|
|
||
| ::: | ||
|
|
||
| 8. traQ の tasks チャンネルで :vscode: スタンプを押す | ||
|
|
||
| ## Step 4: 拡張機能の設定 | ||
|
|
||
| 1. VSCodeの 画面で `Ctrl` + `Shift` + `X` | ||
|
|
||
| 2. 「C++」と入力し、「C/C++ Extenstion」の拡張機能を追加 | ||
| 2. 「C++」と入力し、「C/C++ Extenstion Pack」の拡張機能を追加 | ||
|
|
||
| 3. `Code Runner` と入力して、「Code Runner」拡張機能を追加 | ||
|
|
||
| 4. `Ctrl` + `,` で設定を開く。下記画像の赤丸で囲んだ部分を押して `settings.json` を開く。 | ||
|  | ||
|
|
||
|  | ||
|
|
||
| 5. もし`"cpp": `で始まる行がなければ、一番最後の行の1つ前の行( `}` の前!)に次のコードを追加する。その前の行に `,` がなかったら追加する。 | ||
|
|
||
| ``` | ||
| "code-runner.executorMap": { | ||
| "cpp": "cd $dir && clang++ -std=c++17 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", | ||
| }, | ||
| ``` | ||
| ``` | ||
| "code-runner.executorMap": { | ||
| "cpp": "cd $dir && clang++ -std=c++17 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", | ||
| }, | ||
| ``` | ||
|
|
||
|  | ||
|  | ||
|
|
||
| ::: tip | ||
| ::: tip | ||
|
|
||
| もしすでに`"cpp": ` で始まる行があった場合、以下のように`g++` を `clang++` に置き換える。 | ||
| もしすでに`"cpp": ` で始まる行があった場合、以下のように`g++` を `clang++` に置き換える。 | ||
|
|
||
| ```diff | ||
| - "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", | ||
| + "cpp": "cd $dir && clang++ -std=c++17 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", | ||
| ``` | ||
| ```diff | ||
| - "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", | ||
| + "cpp": "cd $dir && clang++ -std=c++17 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt", | ||
| ``` | ||
|
|
||
| ::: | ||
| ::: | ||
|
|
||
| 6. `"code-runner.executorMap": {` の行の前に `"code-runner.runInTerminal": true,` を書く(コピペ推奨!!) | ||
|
|
||
| 7. こんな感じになっていれば OK | ||
|  | ||
|
|
||
|  | ||
|
|
||
| ::: warning | ||
|
|
||
| この時点で `settings.json` の編集画面の一部に **赤い波線** がある場合は、入力にミスがある可能性が高いです! | ||
| もう一度確認してみてください。 | ||
|
|
||
| 解決しない場合は近くの TA または [**相談チャンネル** (部内限定)](https://q.trap.jp/channels/event/workshop/pg-basic/sodan) にお知らせください。 | ||
|
|
||
| ::: | ||
|
|
||
| 8. WSL を開き、 `code main.cpp` と入力する | ||
|
|
||
| 9. 次のように書く(コピペでも OK ) | ||
|
|
||
| ```cpp | ||
| #include <iostream> | ||
| using namespace std; | ||
| ```cpp | ||
| #include <iostream> | ||
| using namespace std; | ||
|
|
||
| int main() { | ||
| cout << "Hello, World!" << endl; | ||
| } | ||
| ``` | ||
| int main() { | ||
| cout << "Hello, World!" << endl; | ||
| } | ||
| ``` | ||
|
|
||
| 10. 画像の赤丸で実行してみる。下側の画面に `Hello, World!` が出れば成功! | ||
|  | ||
|
|
||
| ::: tip | ||
| なにか出てきた場合は、代わりに三角の隣の`v` を押して、「Run Code」を押す! | ||
|  | ||
|
|
||
|  | ||
| ::: | ||
| ::: tip | ||
|
|
||
| 三角のボタンが表示されない場合、ウィンドウの左下に「制限モード」と表示されていないか確認してみてください。 | ||
|
|
||
| 表示されている場合にはそこをクリックして、その先の画面で「信頼する」をクリックしてください。 | ||
| (画像の赤枠部分) | ||
|
|
||
|  | ||
|
|
||
| ::: | ||
|
|
||
| ::: tip | ||
|
|
||
| ボタンを押してもうまくいかない場合は、代わりに三角の隣の `v` を押して、「Run Code」を押してみてください! | ||
|
|
||
|  | ||
|
|
||
| ::: | ||
|
|
||
| 11. traQ の tasks チャンネルで :done: を押す | ||
| 11. traQ の tasks チャンネルで :done: スタンプを押す | ||
|
|
||
| 12. 環境構築はこれで完了です!お疲れ様でした。 :blob_pyon: | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tip でくくるとちょっと眼であっちこっち行きそうなので、こんな感じに変えてみたいんだけどどうでしょう?