我正在尝试使用waf构建一个Gstreamer程序。我遇到了一些麻烦,包括带有waf的gstream文件。
我收到了错误。
[4/37] qxx:test / Playback / GSTEngine.cpp - > 构建/测试/播放/ GSTEngine.cpp.4.o ../test/Playback/GSTEngine.cpp:1:21:致命错误:gst / gst.h:没有这样的 文件或目录
我的wscript(waf)文件
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_cxx qt4 compiler_c')
#opt.recurse(subdirs)
def configure(conf):
conf.load('compiler_cxx qt4 compiler_c boost')
conf.check_cfg(atleast_pkgconfig_version='0.0.0')
gstreamer_version = conf.check_cfg(modversion='gstreamer-0.10', mandatory=True)
conf.check_cfg(package='gstreamer-0.10')
conf.check_cfg(package='gstreamer-0.10', uselib_store='MYGSTREAMER', mandatory=True)
program_options')
conf.env.append_value('CXXFLAGS', ['-DWAF=1']) # test
def build(bld):
cxxflags = bld.env.commonCxxFlags
uselibcommon = 'QTMAIN QTCORE QTGUI QTOPENGL QTSVG QWIDGET QTSQL QTUITOOLS QTSCRIPT gstreamer-0.10'
bld(features = 'qt4 cxx', includes = '.', source = 'Util.cpp' , target = 'Util.o', uselib = uselibcommon, cxxflags=cxxflags)
bld(features = 'qt4 cxx', includes = '.', source = 'MetaData.cpp' , target = 'MetaData.o', uselib = uselibcommon, cxxflags=cxxflags)
bld(features = 'qt4 cxx', includes = '.', source = 'id3.cpp' , target = 'id3.o', uselib = uselibcommon, cxxflags=cxxflags)
use = [ 'MetaData.o', 'Util.o' , 'id3.o']
bld(features = 'qt4 cxx', includes = '.' , source = 'GSTEngine.cpp' , target = 'GSTEngine.o', uselib = uselibcommon, use = use, lib = ['gstreamer-0.10'], libpath = ['/usr/lib'], cxxflags=cxxflags)
from waflib.TaskGen import feature, before_method, after_method
@feature('cxx')
@after_method('.')
@before_method('apply_incpaths')
def add_includes_paths(self):
incs = set(self.to_list(getattr(self, 'includes', '')))
for x in self.compiled_tasks:
incs.add(x.inputs[0].parent.path_from(self.path))
self.includes = list(incs)
如果我尝试将此列表包含在GSTEngine.cpp bld语句中的include参数中。它可以工作并转到下一个文件。
[ '的/ usr /包括/ gstreamer的-0.10', '/ usr / include目录/油嘴-2.0', '/usr/lib/x86_64-linux-gnu/glib-2.0/include/', '的/ usr /包括/的libxml2 /']
我是waf的新手,想知道如何告诉waf接受所有依赖gstreamer的包含文件。
希望你能帮助我,谢谢。
答案 0 :(得分:0)
我得到了解决方案
我在waf
的conf部分添加了这一行conf.check_cfg(atleast_pkgconfig_version='0.0.0')
conf.check_cfg(package='gstreamer-0.10', uselib_store='GSTREAMER', args='--cflags --libs', mandatory=True)
conf.check_cfg(package='taglib', uselib_store='TAGLIB', args='--cflags --libs', mandatory=True)
好的pkg-config找到lib并将其存储在uselib变量(uselib_store='TAGLIB'
)中。所以只需将变量添加到waf的构建部分中的uselib
bld(features ='qt4 cxx cxxprogram',includes = include,source = 'main.cpp MasterDetail.qrc',target ='app',uselib ='TAGLIB GSTREAMER', cxxflags = cxxflags,use = use,subsystem ='windows',linkflags = linkflags)