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

查看:20
本文介绍了如何在 Visual Studio 代码中使用 `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.

My file looks like this:

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

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`"]

Returns this message:

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

解决方案

you can try this!

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

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

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

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