zoukankan      html  css  js  c++  java
  • linux下visual studio code配置c++调试环境实例

    test1.cpp源码如下:

    #include <stdio.h>
    #include <libxl.h>
    using namespace libxl;

    int main()
    {
    Book* book = xlCreateBook();
    if(book)
    {
    Sheet* sheet = book->addSheet("Sheet1");
    if(sheet)
    {
    sheet->writeStr(2, 1, "Hello, world!");
    sheet->writeNum(3, 1, 1000);
    }
    book->save("example.xls");
    book->release();
    }
    }
     
    luanch.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": "test1",
    "type": "cppdbg",
    "request": "launch",
    "program": "${workspaceFolder}/test1",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": false,
    "MIMode": "gdb",
    "setupCommands": [
    {
    "description": "Enable pretty-printing for gdb",
    "text": "-enable-pretty-printing",
    "ignoreFailures": true
    }
    ],
    "preLaunchTask": "build",
    "miDebuggerPath": "/usr/bin/gdb"
    }
    ]
    }
     
    task.json中代码如下:
    {
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
    {
    "label": "build",
    "type": "shell",
    "command": "cd ${workspaceFolder} && g++ test1.cpp -I/home/program/libxl-3.8.8.2/include_c/ -L/home/program/libxl-3.8.8.2/lib/ -lxl -o test1}"
    }
    ]
    }
  • 相关阅读:
    git简单使用命令
    localStorage的用法
    CSS3 进阶
    ASP.NET应用程序与页面生命周期
    IT专业人士如何更有效的学习专业知识
    jsonp跨域原理解析
    sql注入原理
    ajax跨域调用
    aspx、ashx以及cs的关系,viewState
    Js处理json数据
  • 原文地址:https://www.cnblogs.com/rohens-hbg/p/12704857.html
Copyright © 2011-2022 走看看