{"id":16302732,"url":"https://github.com/toyobayashi/vscode-vc-demo","last_synced_at":"2026-05-04T07:37:30.617Z","repository":{"id":105075314,"uuid":"148628183","full_name":"toyobayashi/vscode-vc-demo","owner":"toyobayashi","description":"Compiling and debugging C++ code with Visual Studio Code and VC compiler. Windows only.","archived":false,"fork":false,"pushed_at":"2018-10-17T06:18:54.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-10T09:48:25.885Z","etag":null,"topics":["c","cpp","debug","nodejs-cpp-addon","vs2017","vscode"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toyobayashi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-13T11:31:36.000Z","updated_at":"2018-10-17T06:18:56.000Z","dependencies_parsed_at":"2023-03-13T14:50:38.635Z","dependency_job_id":null,"html_url":"https://github.com/toyobayashi/vscode-vc-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/toyobayashi/vscode-vc-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyobayashi%2Fvscode-vc-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyobayashi%2Fvscode-vc-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyobayashi%2Fvscode-vc-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyobayashi%2Fvscode-vc-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toyobayashi","download_url":"https://codeload.github.com/toyobayashi/vscode-vc-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toyobayashi%2Fvscode-vc-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32599406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","debug","nodejs-cpp-addon","vs2017","vscode"],"created_at":"2024-10-10T20:58:48.446Z","updated_at":"2026-05-04T07:37:30.583Z","avatar_url":"https://github.com/toyobayashi.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-vc-demo\n\n在 Visual Studio Code 中使用 VC 编译器编译并调试 C++ 代码。本仓库只面向 Windows 用户。\n\n## 准备\n\n1. 安装 1.22.1 版本以后的 Visual Studio Code 并安装 C/C++ 扩展\n2. 安装 Visual Studio 2017 并安装 「使用 C++ 的桌面开发」。如果开发 Node.js 原生模块则需要安装对应架构的 Node.js 及其头文件到 ```${env:HOME}/.node-gyp/${config:nodeVersion}```，或使用 [node-gyp](https://www.npmjs.com/package/node-gyp)\n\n    ``` cmd\n    \u003e node-gyp install [--target=nodeVersion] [--dist-url=https://atom.io/download/electron]\n    ```\n\n3. 添加环境变量 ```VS_ROOT``` ，设置为 Visual Studio 的安装根目录，例如 ```D:\\somewhere\\Microsoft Visual Studio```\n4. 添加环境变量 ```HOME``` ，设置为系统用户根目录，例如 ```C:\\Users\\Administrator```\n\n## 用法\n\n* 使用 Visual Studio Code 打开 ```./console``` （用于开发控制台应用）或 ```./node``` （用于开发 Node.js 原生模块）文件夹\n* 在 ```./*/.vscode/settings.json``` 的配置 ```targetName``` （目标文件名）和 ```sources```  （编译源文件）， ```nodeVersion``` 选项（可选）用于寻找 Node.js 或 Electron 的头文件，例如 ```8.12.0```、 ```iojs-2.0.9```\n* 在 ```./*/vcbuild.bat``` 中配置编译和链接选项，具体可参照[巨硬文档](https://docs.microsoft.com/zh-cn/cpp/build/reference/c-cpp-building-reference)\n\n### 控制台应用\n\n* ```F5``` 编译生成 x64 (debug) 并启动调试，可以跟断点\n* ```Ctrl + Shift + B``` 编译生成 x64 (release)\n\n### Node.js 原生模块\n\n1. 在 JavaScript 或 TypeScript 入口第 1 行打好断点，启动对应的 Node.js 调试进程\n2. 在 C++ 代码中打断点，启动 \"VC++ Attach\"，附加到 Node.js 调试进程\n\n* ```Ctrl + Shift + B``` 编译生成 x64 (release)\n\n**注意**：调试 Node.js 32 位的原生模块时需要使用 32 位的 ```node.exe```。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoyobayashi%2Fvscode-vc-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoyobayashi%2Fvscode-vc-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoyobayashi%2Fvscode-vc-demo/lists"}