新人求教ubuntu下vscode的c++配置问题
vscode吧
全部回复
仅看楼主
level 1
Quantxxxx 楼主
问题描述:
按照一个帖子的配置设置了.json但是写了一个c程序按下F5就会提示:
launch: program '/home/mengtairun/myfile/a.out' does not exist
如果自己在那个目录弄一个a.out,那每次按F5就老是执行a.out,根本不编译我写的代码
以下是我的配置信息:
launch:
{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/a.out", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ]}
tasks.jason
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "echo", "type": "shell", "command": "g++ -g -o a.out program.cpp", "group": { "kind": "build", "isDefault": true } } ]}
自己鼓捣了好几天也没解决= =。求助呀~~~
2018年08月13日 08点08分 1
level 1
2018年08月13日 09点08分 2
阿~我按照这个文章写的做了,可是就是如果鼠标圈中代码选run code就可以,但按F5编译又有这个错误:preLaunchTask“build”已终止,退出代码为 1。
2018年08月13日 10点08分
阿!搞定了!我把C文件改成.cpp就好了,之前是.c。十分感谢您!
2018年08月13日 10点08分
1