在Ubuntu 16.04上找不到printf.c
我最近切换到了Ubuntu 16.04。我正在Ubuntu上为as IDE使用在Ubuntu 16.04上找不到printf.c,c,linux,ubuntu,visual-studio-code,vscode-settings,C,Linux,Ubuntu,Visual Studio Code,Vscode Settings,我最近切换到了Ubuntu 16.04。我正在Ubuntu上为as IDE使用vscode。我配置了其他语言,但无法为C/C++配置。我创建了c\u cpp\u properties.json、launch.json和tasks.json。当我开始编译任意给定代码时,当fit函数如printf或malloc时,它会给出一个错误。 错误消息: 无法打开“printf.c”:找不到文件(file:///build/glibc-Cl5G7W/glibc-2.23/stdio-common/printf
vscode
。我配置了其他语言,但无法为C/C++
配置。我创建了c\u cpp\u properties.json、launch.json和tasks.json
。当我开始编译任意给定代码时,当fit函数如printf
或malloc
时,它会给出一个错误。
错误消息:
无法打开“printf.c”:找不到文件(file:///build/glibc-Cl5G7W/glibc-2.23/stdio-common/printf.c)
我怎样才能解决这个问题
launch.json
tasks.json
c_cpp_properties.json
不幸的是,Debian和Ubuntu没有将源代码作为调试包的一部分提供。据我所知,也没有计划将货源作为该计划的一部分
相比之下,Fedora及其下游发行版拥有广泛的基础设施,可以准备可用的源文件进行调试。这样做并不十分简单,因为它需要重写DWARF数据中从构建树位置到安装位置的文件路径。但它确实有助于调试,并为整个发行版提供了一种很好的自由软件风格。这是一项功能,而不是一个bug。字面上他们说这是“设计”的:“当fit像printf或malloc这样运行时,它会给出一个错误。”,这是什么意思?有一个打字错误。它不合适,会被击中。我从windows 10切换。我不想再使用Windows了。这是一个全新的Linux环境。如果你想用源代码进入系统库,恐怕Ubuntu不是正确的选择。选择这个发行版当然还有其他原因,但源代码调试不在其中。我现在很高兴。它与VScode完美结合。我可以调试没有任何问题。我用过的最好的发行版
{
// 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}/test.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "gcc",
"args": [
"-g",
"pointer_revision.c",
"-o",
"test.exe"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
{
"configurations": {
"name": "Linux",
"includePath": [
"${workspaceFolder}",
"/usr/include/x86_64-linux-gnu/5/include",
"/usr/local/include",
"/usr/include/x86_64-linux-gnu/5/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"${workspaceFolder}",
"/usr/include/x86_64-linux-gnu/5/include",
"/usr/local/include",
"/usr/include/x86_64-linux-gnu/5/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"compilerPath": "/usr/bin/gcc"
}
}