C中的C代码错误。 peraunchtask' c/c++:gcc.exe构建活动文件'用退出代码-1终止
我真的是C和VS代码的新手,当我尝试编译代码时遇到了此错误:
#include <cs50.h>
#include <stdio.h>
int main(void)
{
string answer = get_string("What's your name? ");
printf("hello, %s", answer);
}
此错误出现,但是当我按“显示错误”时,它说我没有任何东西,当我按“无论如何”调试时,它显示
/strong>:
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/Administrator/Desktop/CS50/lecture1",
"program": "c:/Users/Administrator/Desktop/CS50/lecture1/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/mingw64/bin",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
它只有在我安装CS50.H之后才开始出现,如果我尝试运行一个没有文件的文件,那就很好。
感谢任何帮助,谢谢!
I am really new to C and VS Code and came across this error when I try to compile the code:
#include <cs50.h>
#include <stdio.h>
int main(void)
{
string answer = get_string("What's your name? ");
printf("hello, %s", answer);
}
This error shows up, but when I press "Show Errors" it says that I don't have any and when I press "Debug Anyway" it shows another one, saying that there is no such file as hello.c and sends me to launch.json
The launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/Administrator/Desktop/CS50/lecture1",
"program": "c:/Users/Administrator/Desktop/CS50/lecture1/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/mingw64/bin",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
It only started appearing after I installed cs50.h and if I try to run a file without it, then it's fine.
I would appreciate any help, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论