vscode新建sqlite3数据库配置编译文件的方法一

vscode新建sqlite3数据库配置编译文件的方法一

准备sqlite3.lib库文件

  1. 按照VS2019下的Link.exe工具生成sqlite3.lib库
  2. 将已经利用 link.exe 编译完成的sqlite3.lib库及sqlite3.dll文件复制到到项目目录下的include文件夹下,
  3. shell.c,sqlite3.c,sqlite3.h与项目C源文件放在同一目录下,
  4. 上述文件可以从官网下载,
  5. 生成 launch.json和tasks.json文件,
  6. launch.json文件内容:(已经安装了CodeLLDB插件和Make + lldb configuration时使用)
{
  "configurations": [
    {
      "name": "Run and debug C Program",
      "type": "lldb",
      "request": "launch",
      "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
      "args": [],
      "cwd": "${fileDirname}",
      "preLaunchTask": "makelldb: make",
    }
  ]
}
  1. tasks.json文件内容:
{ "version": "2.0.0",
  "tasks": [
    {
      "type": "process",
      "label": "makelldb: make",
      "command": "D:\\mingw64\\bin\\clang.exe",
      "args": [
        "-g",
        "-Wall",
        "${file}",
        "sqlite3.c",
        "-I",
        "${fileDirname}\\include/",
        "-L",
        "${fileDirname}\\include/",
        "-o",
        "${fileBasenameNoExtension}.exe"
      ],
      "options": {
        "cwd": "${fileDirname}"
      },
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}
  1. 执行 RUN BUILD TASK命令, 生成.exe文件。
  2. 备注;项目较大,则可选用CMAKE工具。

Original: https://blog.csdn.net/fgh5566/article/details/125040150
Author: fgh5566
Title: vscode新建sqlite3数据库配置编译文件的方法一

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/816113/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球