Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7644483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:41:58+00:00 2026-05-31T09:41:58+00:00

I am trying to building my project using waf.The Project is complied properly but

  • 0

I am trying to building my project using waf.The Project is complied properly but there is some link error.Its fails to link to with the Resources file (.qrc file)

main.cpp.1.o: In function main':
/home/sobingt/project/masterdetail/build/../main.cpp:20: undefined reference
to
qInitResources_masterdetail()’

WAF output –zones=deps

    sobingt@tuneb03-System-Product-Name:~/projects/masterdetail$ ./waf --zones=deps 
Waf: Entering directory `/home/sobingt/projects/masterdetail/build'
10:49:34 deps deps for [/home/sobingt/projects/masterdetail/main.cpp]: [/home/sobingt/projects/masterdetail/mainwindow.h, /home/sobingt/projects/masterdetail/listmodel.h, /home/sobingt/projects/masterdetail/cache.h, /home/sobingt/projects/masterdetail/tablemodel.h, /home/sobingt/projects/masterdetail/mytablemodel.h]; unresolved ['QApplication', 'QPalette', 'QPixmap', 'QSplashScreen', 'qthread.h', 'boost/scoped_ptr.hpp', 'QMainWindow', 'QModelIndex', 'QAbstractListModel', 'QList', 'QVariant', 'tr1/unordered_map', 'QAbstractTableModel', 'QStringList', 'iostream', 'sstream', 'vector']
10:49:34 deps scanner for qxx: main.cpp -> build/main.cpp.1.o  returned [/home/sobingt/projects/masterdetail/mainwindow.h, /home/sobingt/projects/masterdetail/listmodel.h, /home/sobingt/projects/masterdetail/cache.h, /home/sobingt/projects/masterdetail/tablemodel.h, /home/sobingt/projects/masterdetail/mytablemodel.h] ['QApplication', 'QPalette', 'QPixmap', 'QSplashScreen', 'qthread.h', 'boost/scoped_ptr.hpp', 'QMainWindow', 'QModelIndex', 'QAbstractListModel', 'QList', 'QVariant', 'tr1/unordered_map', 'QAbstractTableModel', 'QStringList', 'iostream', 'sstream', 'vector']
[14/15] qxx: main.cpp -> build/main.cpp.1.o
[15/15] cxxprogram: build/main.cpp.1.o build/mainwindow.cpp.1.o build/masterdetail_rc.o build/cache.cpp.1.o build/listmodel.cpp.1.o build/model.cpp.1.o build/mysortfilterproxymodel.cpp.1.o build/mytablemodel.cpp.1.o build/song.cpp.1.o build/songitem.cpp.1.o build/songs.cpp.1.o build/tablemodel.cpp.1.o build/tableproxymodel.cpp.1.o -> build/app
main.cpp.1.o: In function `main':
/home/sobingt/projects/masterdetail/build/../main.cpp:20: undefined reference to `qInitResources_masterdetail()'
main.cpp.1.o: In function `~MainWindow':
/home/sobingt/projects/masterdetail/build/../mainwindow.h:22: undefined reference to `vtable for MainWindow'
/home/sobingt/projects/masterdetail/build/../mainwindow.h:22: undefined reference to `vtable for MainWindow'
mainwindow.cpp.1.o: In function `MainWindow':
/home/sobingt/projects/masterdetail/build/../mainwindow.cpp:22: undefined reference to `vtable for MainWindow'
/home/sobingt/projects/masterdetail/build/../mainwindow.cpp:22: undefined reference to `vtable for MainWindow'
mainwindow.cpp.1.o: In function `ListItem':
/home/sobingt/projects/masterdetail/build/../listmodel.h:14: undefined reference to `vtable for ListItem'
mainwindow.cpp.1.o: In function `MainWindow::tr(char const*, char const*)':
/home/sobingt/projects/masterdetail/build/../mainwindow.h:24: undefined reference to `MainWindow::staticMetaObject'
mainwindow.cpp.1.o: In function `SongItem':
/home/sobingt/projects/masterdetail/build/../songitem.h:17: undefined reference to `vtable for SongItem'
listmodel.cpp.1.o: In function `ListModel':
/home/sobingt/projects/masterdetail/build/../listmodel.cpp:7: undefined reference to `vtable for ListModel'
listmodel.cpp.1.o: In function `~ListModel':
/home/sobingt/projects/masterdetail/build/../listmodel.cpp:27: undefined reference to `vtable for ListModel'
mysortfilterproxymodel.cpp.1.o: In function `MySortFilterProxyModel':
/home/sobingt/projects/masterdetail/build/../mysortfilterproxymodel.cpp:4: undefined reference to `vtable for MySortFilterProxyModel'
mytablemodel.cpp.1.o: In function `MyTableModel':
/home/sobingt/projects/masterdetail/build/../mytablemodel.cpp:3: undefined reference to `vtable for MyTableModel'
tablemodel.cpp.1.o: In function `TableModel':
/home/sobingt/projects/masterdetail/build/../tablemodel.cpp:9: undefined reference to `vtable for TableModel'
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/sobingt/projects/masterdetail/build'
Build failed
 -> task failed (exit status 1): 
    {task 14658768: cxxprogram main.cpp.1.o,mainwindow.cpp.1.o,masterdetail_rc.o,cache.cpp.1.o,listmodel.cpp.1.o,model.cpp.1.o,mysortfilterproxymodel.cpp.1.o,mytablemodel.cpp.1.o,song.cpp.1.o,songitem.cpp.1.o,songs.cpp.1.o,tablemodel.cpp.1.o,tableproxymodel.cpp.1.o -> app}
['/usr/bin/g++', 'main.cpp.1.o', 'mainwindow.cpp.1.o', 'masterdetail_rc.o', 'cache.cpp.1.o', 'listmodel.cpp.1.o', 'model.cpp.1.o', 'mysortfilterproxymodel.cpp.1.o', 'mytablemodel.cpp.1.o', 'song.cpp.1.o', 'songitem.cpp.1.o', 'songs.cpp.1.o', 'tablemodel.cpp.1.o', 'tableproxymodel.cpp.1.o', '-o', '/home/sobingt/projects/masterdetail/build/app', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lQtCore', '-lQtGui', '-lQtCore', '-lQtOpenGL', '-lQtGui', '-lQtCore', '-lQtSvg', '-lQtGui', '-lQtCore', '-lQtSql', '-lQtCore', '-lQtUiTools', '-lQtXml', '-lQtCore', '-lQtScript', '-lQtCore']

wscript file

VERSION='0.0.1'
APPNAME='qt4_test'

top = '.'
out = 'build'

def options(opt):
    opt.load('compiler_cxx qt4')

def configure(conf):
    conf.load('compiler_cxx qt4')
    conf.env.append_value('CXXFLAGS', ['-g']) # test

def build(bld):
    def build(bld):
bld(
    features = 'qt4 cxx',
    uselib   = 'QTCORE QTGUI QTOPENGL QTSVG QWIDGET QTSQL QTUITOOLS QTSCRIPT',
    includes = bld.env.INCLUDES_QTGUI,
    source   = 'mainwindow.cpp masterdetail.qrc cache.cpp listmodel.cpp model.cpp mysortfilterproxymodel.cpp mytablemodel.cpp  song.cpp songitem.cpp songs.cpp tablemodel.cpp tableproxymodel.cpp',
    target   = 'mainwindow.o',
)   
bld(
    features = 'qt4 cxx cxxprogram',
    uselib   = 'QTCORE QTGUI QTOPENGL QTSVG QWIDGET QTSQL QTUITOOLS QTSCRIPT',
    includes = bld.env.INCLUDES_QTGUI,
    source   = 'main.cpp',
    target   = 'app',
    use  = 'mainwindow.o',

)

tree structure

├── build
│   ├── c4che
│   │   ├── build.config.py
│   │   └── _cache.py
│   ├── config.log
│   ├── main.cpp.1.o
│   ├── masterdetail_rc.cpp
│   └── masterdetail_rc.o
├── cache.cpp
├── cache.h
├── images
│   ├── betaLogo.png
│   ├── exitButton.gif
│   ├── icon.png
│   ├── image.png
│   ├── mas.png
│   ├── play.png
│   ├── saveButton.png
│   ├── stopbutton.png
│   └── stop.png
├── listmodel.cpp
├── listmodel.h
├── main.cpp
├── mainwindow.cpp
├── mainwindow.h
├── Makefile
├── masterdetail64.png
├── masterdetail80.png
├── masterdetail.desktop
├── masterdetail_harmattan.desktop
├── masterdetail.pro
├── masterdetail.pro.user
├── masterdetail.qrc
├── masterdetail.svg
├── model.cpp
├── model.h
├── mysortfilterproxymodel.cpp
├── mysortfilterproxymodel.h
├── mytablemodel.cpp
├── mytablemodel.h
├── repository.db
├── song.cpp
├── song.h
├── songitem.cpp
├── songitem.h
├── songs.cpp
├── songs.h
├── tablemodel.cpp
├── tablemodel.h
├── tableproxymodel.cpp
├── tableproxymodel.h
├── tableUnit.cpp
├── waf
├── waf-1.6.11
├── wscript

I know it must be a stupid mistake.Please help.
Link to Question posted in qtcentre
I know it must be a stupid mistake.Please help. Link to Question posted in qtcentre

Solution i am trying out now:
I am running moc on all headers (or source) file containing a Q_OBJECT macro.

 moc -o moc_something.cpp something.h

and then the moc_something.cpp is added to the sources being built.

I am trying for resource compiler:

 rcc -o masterdetail.cpp masterdetail.qrc

and then the masterdetail.cpp has to be added to the sources being built.

I think the above is done by the qmake automatically..i am compiling it manually to try to find a proper solution

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:42:00+00:00Added an answer on May 31, 2026 at 9:42 am

    It seems waf is not collecting moc files. According with waf docs, try adding something like this:

    from waflib.TaskGen import feature, before_method, after_method
    
    @feature('cxx')
    @after_method('process_source')
    @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)
    

    process_source should take care of the moc files processing

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using qmake for building a project of mine. I have been trying to
I'm trying to run jetty without building the whole project, but simply point jetty
I am trying to build a project using TFS2010 Build.TFS resides on its own
i'm using QT Creator 1.3.1 and trying to compile, but get this error... please
I was just trying to build my android project using Maven-Android-Plugin. But it's giving
We're building a project using NHibernate and Castle with the Validators project. I'm trying
I am building a project using story boards and a MasterView layout. I'm trying
I'm building an iPhone application and trying to create a savePDFFile method by using
I am building a socketserver using Apache Mina and I am trying to make
I am a beginner coder, i am building a project using C# Asp.Net in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.