windows环境下:本想安装MinGW,
发现win_build集成度更好,建议使用
Mingw-w64https://www.mingw-w64.org/(Free) Software Building and Packaging For Windows [Win-builds]http://win-builds.org/doku.php
win_build下载安装很方便,直接用国外镜像也很快,也可以安装文档做本地镜像
#Run wget to mirror the files. For Windows, you can download a portable installation of wget. The following command will create a directory named 1.5.0 suitable for both 32 and 64 bits.
wget -r --no-parent --no-host-directories http://win-builds.org/1.5.0/packages/
#Finally, download the installer and save it as win-builds.exe (or rename it afterwards); run it by double-clicking on it. When prompted for the mirror, provide the path to the 1.5.0 directory that was created by the mirroring process:
C:\path\to\the\newly\created\directory\1.5.0
使用在线镜像慢的要死。
Index of /1.5.0/packages/windows_64下的所有文件下载到本地
设置本地源:
编辑C:\win_builds\etc\yypkg.d\yypkg.conf
把镜像指向本地
((preds((host(x86_64-w64-mingw32))(host_system("Native Windows"))(target(x86_64-w64-mingw32))))(mirror C:\package))
把D:\win_build\bin可执行程序目录加入到系统PATH变量
汇编环境:DTDebug
C语言IDE:vscode
插件安装完成后 重启 VSCode
新建一个文件夹(放 c++ 代码文件)
打开新建的文件夹(快捷键 Ctrl+k Ctrl+O)
在此文件夹新建一个 .vscode 文件夹
参考官网说明(for MAC)
Create Hello World
From the macOS Terminal, create an empty folder called projects where you can store all your VS Code projects, then create a subfolder called helloworld, navigate into it, and open VS Code in that folder by entering the following commands:mkdir projects
cd projects
mkdir helloworld
cd helloworld
code .
The code . command opens VS Code in the current working folder, which becomes your "workspace". As you go through the tutorial, you will create three files in a .vscode folder in the workspace:tasks.json (compiler build settings)
launch.json (debugger settings)
c_cpp_properties.json (compiler path and IntelliSense settings)原文链接:https://blog.csdn.net/lm19770429/article/details/107357672
Windows中:
删除了.vscode目录,可以立刻生成。
至此,所有终端运行生成的配置文件自动生成完毕!!!!
下面做调试的自动生成设置:添加配置
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "D:\\win_build\\bin",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"cwd": "d:\\VSCODE_CPP",
"environment": [],
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"internalConsoleOptions": "openOnSessionStart",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"externalConsole": false,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}