test1.cpp源码如下:
linux下visual studio code配置c++调试环境实例
转载#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}"
}
]
}
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Windows配置C++的GDAL模块:Visual Studio环境
本文介绍在Visual Studio软件中配置、编译C++ 环境下GDAL库、SQLite环境与PROJ库的详细方法~
C++ GDAL 开发环境 VS Windows -
Visual Studio如何再次配置一个曾经配置过的C++库?
本文介绍在Visual Studio软件中调用C++ 各种配置、编译完毕的第三方库的方法~
Visual Studio VS C++ 第三方库 开发环境 -
Visual Studio Code (VS Code) – C++ 入门
基于 Visual Studio Code 官方文档的全面的、具体的Visual Studio Code – C++ 入门级教程
Code Visual Windows C++ 教程 -
Visual Studio C++代码调试设置
Visual Studio C++代码调试设置调试模式 当前不会命中断点
VS 设置 调试目录 release 当前不会命中断点