- Vscode 配置c,c++的编译环境。.vscode目录下有3个文件:launch.json、settings.json、tasks.json
- 然后安装个runcode插件,以后写好代码,直接点右上角的三角形就可以跑了。
下面的是三个文件是生成c和c++的,将执行文件生成在编写代码的目录中。
例如:写个hello.c文件,然后点三角就是hello,控制台有输出。这后在控制台./hello也可以运行。
launch.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": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"preLaunchTask": "build", //为新的代码重新创建launch任务
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
setting.json
{
"files.associations": {
"iostream": "cpp"
}
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "g++",
"args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]
}
]
}
- 正常安装lua5.3.0,网上很多,可能需要修改makefile的那种安装方式
- 最后写了lua的c 上面的配置不支持点击,而是用命令执行:
gcc -o 取名:可执行文件名字 源代码:xxx.c -llua -lm -ldl
例如:gcc -o test test.c -llua -lm -ldl