【发布时间】:2013-03-08 16:59:26
【问题描述】:
我正在尝试使用 sublime text 2 构建 opencv 源代码,但使用 pkg-config 链接 opencv 库似乎存在问题
我的C++.sublime-build
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "g++ -ggdb '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}' `pkg-config --cflags --libs opencv`"]
}
]
}
PS:当我尝试从终端编译我的程序时,此编译成功。
g++ -ggdb source.cpp `pkg-config --cflags --libs opencv`
【问题讨论】:
-
您将“source.c++”作为选择器而不是“source.cpp”。我不知道这是否有问题。
-
没关系,因为它在默认的 c++.sublime-build 中是一样的
标签: linux sublimetext2 pkg-config