vscode比较强大,但是最新版本已经不支持windows7了。我用无版本进行。
VSCodeSetup-x64-1.70.2.exe
安装c++ pack就可以了。
在extensions的cmake-tool有一个比较重要的参数要设:
就是CMake Genrator: MinGW Makefiles
如果不设置,也可以在C:\msys64\mingw64\bin中复制mingw32-make.exe并且修改为make.exe
要不就会出错:
修改就可以了
Build,成功。生成
settings.json如下:
{
"workbench.colorTheme": "Default Dark+",
"C_Cpp.default.compilerPath": "C:\\msys64\\mingw64\\bin\\g++.exe",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.intelliSenseMode": "windows-gcc-x64",
"cmake.configureOnOpen": true,
"cmake.cacheInit": null,
"cmake.cmakePath": "C:\\Program Files\\CMake\\bin\\cmake.exe",
"C_Cpp.default.customConfigurationVariables": {
},
"cmake.generator": "MinGW Makefiles",
"editor.fontSize": 18,
"update.enableWindowsBackgroundUpdates": false,
"update.mode": "none",
"latex-workshop.latex.tools": [
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
],
},
{
"name": "pdflatex",
"tools": [
"pdflatex"
]
},
{
"name": "xe->bib->xe->xe",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdf->bib->pdf->pdf",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
],
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
//tex文件浏览器,可选项为"none" "browser" "tab" "external"
"latex-workshop.view.pdf.viewer": "tab",
//自动编译tex文件
"latex-workshop.latex.autoBuild.run": "onFileChange",
//显示内容菜单:(1)编译文件;(2)定位游标
"latex-workshop.showContextMenu": true,
//显示错误
"latex-workshop.message.error.show": false,
//显示警告
"latex-workshop.message.warning.show": false,
//从使用的包中自动补全命令和环境
"latex-workshop.intellisense.package.enabled": true,
//设置为never,为不清除辅助文件
"latex-workshop.latex.autoClean.run": "never",
//设置vscode编译tex文档时的默认编译链
"latex-workshop.latex.recipe.default": "lastUsed",
// 用于反向同步的内部查看器的键绑定。ctrl/cmd +点击(默认)或双击
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click"
}
多谢,亲爱的美美。
年例快乐,开开心心。