I have this Qt program that I create with waf . I test it on Windows and every time I run an exe file the console opens. In the (Qt) pro file (if you are building with qmake) you just need to make sure you delete
CONFIG += console
But I'm not sure which linker flag I should add to my wscript (waf) for this to happen. I need to specify /SUBSYSTEM: WINDOWSfor msvc-complier to take my program as a window program
Please, help.
my wscript.py
"""
Including the moc files *is* the best practice (KDE), not doing it is easy,
but makes the compilations about 30-40% slower on average.
If you still want the slow version (we warned you!), see the example located
in the folder playground/slow_qt/
"""
VERSION='0.0.1'
APPNAME='qt4_test'
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_cxx qt4 compiler_c boost')
def configure(conf):
conf.load('compiler_cxx qt4 compiler_c boost')
conf.env.append_value('CXXFLAGS', ['-DWAF=1'])
def build(bld):
cxxflags = bld.env.commonCxxFlags
uselibcommon = 'QTCORE QTGUI QTOPENGL QTSVG QWIDGET QTSQL QTUITOOLS QTSCRIPT'
bld(features = 'qt4 cxx', includes = '.',source = 'ListModel.cpp', target = 'ListModel.o', uselib = uselibcommon, cxxflags=cxxflags)
bld(features = 'qt4 cxx', includes = '.', source = 'Model.cpp', target = 'Model.o', uselib = uselibcommon, cxxflags=cxxflags)
bld(features = 'qt4 cxx', includes = '.', source = 'ProxyModel.cpp' , target = 'ProxyModel.o', uselib = uselibcommon, cxxflags=cxxflags)
flags = cxxflags + ['-DWAF']
bld(features = 'qt4 cxx', includes = bld.options.boost_includes, source = 'TableModel.cpp', target = 'TableModel.o', uselib = uselibcommon, cxxflags=flags)
bld(features = 'qt4 cxx', includes = '.', source = 'SongItem.cpp', target = 'SongItem.o',use = 'ListModel.o', cxxflags=cxxflags)
use = [ 'sqlite3.o', 'Master.o' , 'DatabaseUtil' , 'SQLiteError.o' , 'Vector.o' , 'Song.o' , 'Songs.o' , 'SQLiteVector.o' , 'SQLiteVectorIterator.o' , 'ListModel.o' , 'Model.o' , 'TableModel.o' , 'SongItem.o' , 'ProxyModel.o']
bld(features = 'qt4 cxx c', uselib = uselibcommon, includes = bld.options.boost_includes , source = 'MainWindow.cpp' , target = 'MainWindow.o', lib = ['phonon'], libpath = ['/usr/lib'], use = use, cxxflags=cxxflags)
use = [ 'sqlite3.o', 'Master.o' , 'DatabaseUtil' , 'SQLiteError.o' , 'Vector.o' , 'Song.o' , 'Songs.o' , 'SQLiteVector.o' , 'SQLiteVectorIterator.o' , 'ListModel.o' , 'Model.o' , 'TableModel.o' , 'SongItem.o' , 'ProxyModel.o',
'MainWindow.o']
bld(features = 'qt4 cxx cxxprogram', includes = bld.options.boost_includes, source = 'main.cpp MasterDetail.qrc', target = 'app', uselib = uselibcommon , cxxflags=cxxflags, use = use, linkflags = (['-Wl,-subsystem,windows']) )
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)