【发布时间】:2018-10-31 13:38:57
【问题描述】:
我前段时间安装了 VS Code for Linux,在工作区中打开了一个 C++ 项目,创建了tasks.json——一般我都是按照谷歌来做的。
当我在终端窗口中运行make 命令时,一切正常。但是当我从 VS Code 执行相同操作(Ctrl+Shift+B)时,我得到了一个错误。
处理我的Makefile 在命令libtool: link: c++ -fPIC -DPIC -shared -nostdlib /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crti.o .... 之后终止
有消息
c++: error: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../x86_64-linux-gnu/crti.o: No such file or directory.
当然,路径是正确的(当我在终端窗口中使用命令行make 时很好)。
tasks.json 的内容很简单(与 microsoft.com 中的相同):
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "ClanLib",
"type": "shell",
"command": "make",
// start the build without prompting for task selection, use "group": "build" otherwise
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
// arg passing example: in this case is executed make QUIET=0
"args": ["QUIET=0"],
// Use the standard less compilation problem matcher.
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["absolute"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
我无法发布Makefile,它包含从https://github.com/sphair/ClanLib 自动生成后的数千行代码...
请帮助设置 Visual Studio Code (Linux Mint)。
【问题讨论】:
-
您好,欢迎来到 SO。请从您的 tasks.json 和 makefile 中提供更多内容。您提供的信息不足以让我们知道可能出了什么问题。
-
你已经安装libc6-dev了吗?
-
Tezirg - 请参阅我更新的帖子。 Ayak973 - 显然没有安装,但从命令行一切正常。
标签: c++ linux visual-studio-code