我正在尝试使用 waf 构建 Gstreamer 程序。我在使用 waf 包含 gstream 文件时遇到了一些问题。
我收到一个错误。
[4/37] qxx:测试/播放/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 语句中的包含参数中。它可以工作并用于下一个文件。
['/usr/include/gstreamer-0.10','/usr/include/glib-2.0', '/usr/lib/x86_64-linux-gnu/glib-2.0/include/', '/usr/include/libxml2 /']
我是 waf 的新手,想知道如何告诉 waf 获取所有依赖于 gstreamer 的包含文件。
希望你能帮助我,谢谢。