首页 > 其他分享 >vscode cpp 遇到的问题

vscode cpp 遇到的问题

时间:2023-07-02 12:11:36浏览次数:58  
标签:bin exe 遇到 vscode fileDirname ++. file cpp active

已解决:could not find the task ‘g++ build active file,leetcode算法ACM编译调试_dlage的博客-CSDN博客

(32条消息) vscode下编译告警“undefined reference”?三步教你如何解决_vscode undefined reference to_飘逸的小松鼠的博客-CSDN博客

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe build active file",
            "command": "C:\\msys64\\mingw64\\bin\\g++.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                // "${file}",
                "${fileDirname}\\*.cpp",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "编译器: C:\\msys64\\mingw64\\bin\\g++.exe"
        }
    ]
}

lauch.json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "g++.exe - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${fileDirname}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "preLaunchTask": "C/C++: g++.exe build active file"
    }
  ]
}

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:/msys64/mingw64/bin/g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

 

标签:bin,exe,遇到,vscode,fileDirname,++.,file,cpp,active
From: https://www.cnblogs.com/dogingate/p/17520576.html

相关文章

  • LINQ问题:模拟并发冲突时遇到的问题(LINQ to SQL)
    问题描述此问题是通过的网友交流获得解决的,首先对参与和关注此问题的网友表示感谢,特别是foren_whb给予了热心地、直接地帮助!谢谢你们!望日后继续进行着广泛地深入的交流!虽然说,谁也不想遇到并发冲突这种情况,但这却是一个必然会发生的事情,因此,学习掌握它的解决办法还是很有必要的。我......
  • VSCODE 快捷键总结
    普通快捷键:注释  Ctrl+/按次选中相同的内容  选中后,Ctrl+D一次性选中所有相同的内容  Ctrl+Shift+L移动行:alt+up/down显示/隐藏左侧目录栏 ctrl+b复制当前行:shift+alt+up/down删除当前行:shift+ctrl+k控制台终端显示与隐藏:ctrl+~查找文件/安装vscod......
  • win11安装Docker 改位置 | vscode + wsl + docker
    起因因为docker安装强制位置【安装没这个选项】是C:\ProgramFiles\Docker解决使用命令mklink/j"C:\ProgramFiles\Docker""D:\Softwars\Docker"若出现解决:把C:\ProgramFiles\Docker这个文件夹删了......
  • vscode 文件关闭后 全局搜索失效
    问题: vscode编译器在文件关闭后,全局搜索失效,无法搜索到文件内容,打开文件后,可以搜索到。原因:电脑安装了绿盾加密软件,对项目文件进行了加密,vscode编译器无法检索关闭的文件。解决方案:对项目文件进行解密操作(申请解密)......
  • cpp: Sudoku
     /*****************************************************************//***\fileConsoleSudoku.cppc++14*\brief九宫独数填充游戏*fromhttps://github.com/vaithak/Sudoku-Generator*\authorgeovindu*\dateJuly2023************************......
  • VSCode gdb 调试 qemu u-boot 的方法
    前言最近使用VSCodeGDB调试qemu,有了一点收获,u-boot编译后生成了一个elf文件:u-boot,是否也可以调试一下?为何需要VSCodeGDB调试,直接gdb调试不就可以了吗?答案就是:VSCode可以界面调试,命令行调试会枯燥很多环境使用qemu,就是不需要板子win1064位VMwareWorkstationPro......
  • cpp: Two-level pointer and double dimensional array
    /*****************************************************************//***\fileConsoleTextFileDemoApp.cppc++14*\brief***\authorgeovindu*\dateJune2023*********************************************************************/......
  • 编译python为可执行文件遇到的问题:使用python-oracledb连接oracle数据库时出现错误:DP
    错误原文:DPY-3010:connectionstothisdatabaseserverversionarenotsupportedbypython-oracledbinthinmode链接数据库方式如下:connection=create_engine("oracle+oracledb://user:password@host:post/dbname") PyCharm编译器内运行成功但编译后会有DP......
  • vscode调整界面大小,缩放字体快捷键
    无意中发现的,缩放快捷键,哈哈。别的工具很多都是Ctrl+鼠标滚轮放大缩小,结果vscode没成功。注意:是缩放了界面导致字体缩放,不是设置中修改字体大小。快捷键:放大:Ctrl++缩小:Ctrl+-......
  • 【VSCode】多行注释
    背景有的时候我们想要对多行的代码进行注释,使用单行注释的话不好看步骤vscode多行注释,修改快捷键:File>>Preferences>>KeyboardShortcuts>>搜索comment>>ToggleBlockComment>>编辑>>按下键盘快捷键>>“回车”确定......