Results 1 to 5 of 5

Thread: cross compile problems - Undefined rinterface & ASSERT failure

  1. #1
    Join Date
    Dec 2009
    Posts
    65
    Thanks
    10
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default cross compile problems - Undefined rinterface & ASSERT failure

    I have linux ubuntu 12.04 with Qt 4.8.1 (latest from repository)
    and windows xp sp3 with Qt 4.8.1 (Qt SDK 1.21 mingw)
    and a aplication that i mainly develop on linux and when time comes, just compile windows version.
    With some "advanced" changes in the code i am not able to compile my code on windows

    1. The compile fails with error: "Undefined interface"
    and when i rearange my code to comment lines with Q_INTERFACES macro it compiles fine.
    Nothing wrong on linux

    2. I created a model extending QAbstractItemModel that also works on linux, but when application is started on windows i get error:
    ASSERT failure in QAbstractItemView::setModel: "A model should return the exact same index (including its internal id/pointer) when asked for it twice in a row.", file itemviews/qabstractitemview.cpp, line 667

    I dont think i am doing anything wrong if it works on linux, or am I?

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: cross compile problems - Undefined rinterface & ASSERT failure

    The fact that you get an assert from qt means you have done something wrong.

    you need to fix the compiler error properly, not randomly cut out bits of your code. Of course you can't say 'it must be ok now since it works on nix' because now you have two different apps!
    Last edited by amleto; 4th December 2012 at 06:59.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Dec 2009
    Posts
    65
    Thanks
    10
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: cross compile problems - Undefined rinterface & ASSERT failure

    The first one is with Q_INTERFACES. That should realy be platform independant.
    I comment it out just to see is that the only problem, and it isn't.
    I plan to fix it (with help from here), not to leave it commented (i spent some time to create the interface)
    The other problem, you are right about one thing, i should not skip to next problem before solving first one.
    Anyway, that code has nothing in common with interface, and should also be platform independant.
    The thing that worries me is that it doesnt feel like "code once, deploy everywhere",

    For the QAbstractModel part, i went to qt source of QAbstractTableModel, and checked implementation, and fixed my own. The question remains, why there isn't ASSERT in linux if it was "something wrong"
    For the Q_INTERFACE part still need help, anyone had simmilar problem, or i am one of few trying to use Q_INTERFACE?

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: cross compile problems - Undefined rinterface & ASSERT failure

    because *nix compilers and win compilers aren't identical. They will not be 100% c++ standard conformant, and indeed some of them let you get away with non-conformant code by filling in the blanks.

    If you want help with your problem, please read my sig.


    Added after 7 minutes:


    oh, and btw, I have just checked 'undefined interface' as it smells a bit - and I was right to suspect something. It is not a c++ compiler error, but a moc error.

    http://lists.trolltech.com/qt-intere...ad00531-0.html
    Last edited by amleto; 4th December 2012 at 12:16.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Dec 2009
    Posts
    65
    Thanks
    10
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: cross compile problems - Undefined rinterface & ASSERT failure

    I created a new project that contains just interface class and implementation class. The project compiled fine. Then i checked compile outputs of working and failing versions.
    There was a significant difference in moc.exe command
    working wersion didn't have a parameter "@debug/mocinclude.tmp"
    Before this thread i googled for "undefined interface" and some results sugested that i shoud remove mocinclude.tmp, and i did that, but without success, it is recreated with same error.
    What is this file, how to avoid creating it? Linux version also executes moc command without "@debug/mocinclude.tmp" parameter.
    Anyone familiar with this?
    @amleto: is example stil needed?
    How do i edit moc parameters?

    I created a new project that contains just interface class and implementation class. The project compiled fine. Then i checked compile outputs of working and failing versions.
    There was a significant difference in moc.exe command
    working wersion didn't have a parameter "@debug/mocinclude.tmp"
    Before this thread i googled for "undefined interface" and some results sugested that i shoud remove mocinclude.tmp, and i did that, but without success, it is recreated with same error.
    What is this file, how to avoid creating it? Linux version also executes moc command without "@debug/mocinclude.tmp" parameter.
    Anyone familiar with this?
    @amleto: is example stil needed?
    How do i edit moc parameters?


    Added after 37 minutes:


    DAMN!!!
    I Lost two days over this stupidity.
    I hope this thread saves someone else's time
    searching for info about mocinclude i found it in Makefile.Debug
    and there i noticed that moc is generated like this

    Qt Code:
    1. debug/mocinclude.tmp:
    2. ...
    3. @echo -IC:/Documents>> debug/mocinclude.tmp
    4. @echo -Iand>> debug/mocinclude.tmp
    5. @echo -ISettings/Administrator/Desktop/myProject/trunk/Core>> debug/mocinclude.tmp
    6. ...
    To copy to clipboard, switch view to plain text mode 
    it split "Documents and settings" into 3 includes
    after moving project to c:\ everything compiled fine.

    The strangest thing is that the new test project is also on desktop and no errors
    Last edited by davidovv; 5th December 2012 at 00:31.

Similar Threads

  1. Help!!!Problems in building Qt4.7.3 for Vxworks.. cross compile
    By study_c in forum Installation and Deployment
    Replies: 1
    Last Post: 7th September 2012, 11:54
  2. Assert failure with tablet installed
    By Spectralist in forum Qt Programming
    Replies: 2
    Last Post: 21st April 2011, 13:31
  3. Replies: 0
    Last Post: 9th April 2009, 06:12
  4. Debugging ASSERT failure in Qt header.
    By Doug Broadwell in forum Qt Programming
    Replies: 6
    Last Post: 27th December 2008, 01:40
  5. QWT assert failure
    By Andimat in forum Qwt
    Replies: 1
    Last Post: 21st June 2007, 14:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.