0
votes

I am trying to build a Gstreamer program using waf.I am having some trouble including gstream files with waf.

I am getting an error.

[ 4/37] qxx: test/Playback/GSTEngine.cpp -> build/test/Playback/GSTEngine.cpp.4.o ../test/Playback/GSTEngine.cpp:1:21: fatal error: gst/gst.h: No such file or directory

my wscript(waf) file

    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)

If i try include this list into the include parameter in GSTEngine.cpp bld statement.It works and goes for the next file.

['/usr/include/gstreamer-0.10','/usr/include/glib-2.0', '/usr/lib/x86_64-linux-gnu/glib-2.0/include/', '/usr/include/libxml2/']

I am new to waf and like to know how can i tell waf to take all gstreamer dependent include files.

hope you can help me,Thankz.

1

1 Answers

0
votes

Well i got the solution

I added this line in conf part of waf

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) 

well pkg-config finds the lib and stores it in the uselib variable(uselib_store='TAGLIB'). so just add the variable to uselib in build part of waf

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)