无法使用pkg配置在VSCode中启动外部程序
Failed to launch external program in VSCode with pkg-config
我创建了一个简单的main.cpp。我还创建了.vscode文件夹下的tasks.json,如下所示。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "g++ $(pkg-config --cflags --libs opencv)",
"isShellCommand": true,
"args": ["main.cpp"],
"showOutput": "always"
}
g++ $(pkg-config --cflags --libs opencv) main.cpp
在终端中正常运行。然而,它在vscode中的任务运行器中不起作用。错误消息为
无法启动外部程序g++$(pkg config--cflags--libs-opencv)
有什么建议吗?
我让我的程序处理以下任务。json:
{
"tasks": [
{
"type": "shell",
"label": "g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"`pkg-config", "--cflags", "--libs", "opencv`"
],
"options": {
"cwd": "/usr/bin"
}
}
],
"version": "2.0.0" }
您必须用"like so"pkg-config", "--cflags", "--libs", "opencv
来分隔每个命令。希望能有所帮助。
相关文章:
- 如何创建一个空的全局类并在启动时实例化它
- vscode g++链路故障:体系结构x86_64的未定义符号
- VSCode-有一个红色下划线,但程序构建和运行正确,并且出现配音错误
- 当使用带有VS2019或VSCode的虚幻引擎4.24.2时,我如何修复这些错误的Intellisense错误
- vscode下的Arduino代码出现意外编译错误
- 即使我读取了所有内容,在FIFO上打开的QSocketNotifier也会一直启动
- 如何使用Clang/GCC在Mac上为C/C++设置VSCode
- 使用 std::string () const 函数启动线程或未来
- 使用vscode调试时,GDB意外退出
- 如何修复valgrind启动时的致命错误(与libc6-dbg和libc6-dbg:i386连接)
- 将向量作为类>(值)<向量启动和向量<类>[值]有什么区别
- VSCode C++ 编译的exe感染了Win32:TrojanX-gen[Trj]
- 如何创建线程序列以按照启动顺序执行任务?
- VSCode IntelliSense无法识别SDL框架的SDL_image扩展库
- WINAPI 注册应用程序重新启动时不清除打开的套接字
- 在挂钩启动新线程时解除挂钩进程
- 程序无法启动,因为缺少 libmpc-3.dll
- 从 exe 文件 (Visual Studio ) 启动时调试断言失败
- 预启动任务和启动可以在VSCode的同一终端内启动吗?
- 无法使用pkg配置在VSCode中启动外部程序