如何在Visual Studio Code中使用`pkg-config gtkmm-3.0 --cflags --libs` [英] How to use `pkg-config gtkmm-3.0 --cflags --libs` in the Visual Studio Code

查看:277
本文介绍了如何在Visual Studio Code中使用`pkg-config gtkmm-3.0 --cflags --libs`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置task.json文件,以便当我按 Ctrl + Shift + B 时,复印机将使用 pkg-config gtkmm-3.0 --cflags --libs

How can I configure the tasks.json file so that when I press Ctrl + Shift + B the copier will use pkg-config gtkmm-3.0 --cflags --libs.

我的文件如下:

"version": "0.1.0",
"command": "g++ `pkg-config gtkmm-3.0 --cflags --libs`",
"isShellCommand": true,
"args": ["main.cpp"]

但它返回此消息:
无法启动外部程序g ++ pkg-config gtkmm-3.0 --cflags --libs main .cpp。生成g ++ pkg-config gtkmm-3.0 --cflags --libs ENOENT

But it returns this message: Failed to launch external program g++ pkg-config gtkmm-3.0 --cflags --libs main.cpp. spawn g++ pkg-config gtkmm-3.0 --cflags --libs ENOENT

如果我把它作为参数,例如:

If I put it as an argument, like this:

"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"args": ["main.cpp", "pkg-config gtkmm-3.0 --cflags --libs`"]

返回以下消息:

g++: error: pkg-config gtkmm-3.0 --cflags --libs`: 
File or directory not found


推荐答案

您可以尝试!

"version": "0.1.0"
"command": "g++",
"isShellCommand": true,
"args": [
         "main.cpp",
         "`pkg-config", "--libs", "--cflags", "gtkmm-3.0`",
 ]

您应该控制引号的引用方式。

更多信息: Visual Studio代码中的任务

you should control how the argument is quoted.
more information: Task in Visual Studio Code

这篇关于如何在Visual Studio Code中使用`pkg-config gtkmm-3.0 --cflags --libs`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆