Results 1 to 11 of 11

Thread: QT Creator doesn`t create main.moc.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT Creator doesn`t create main.moc.

    Quote Originally Posted by malootki View Post
    Thank you very much. It works. Question is : Why QT creators didn`t include it like you?
    Because it should work without specification of the path to that file, on linux it works, on windows it worked when the generated files where in the project folder, i guess that the mingw compiler search for that file only in project folder and can't find it because now the generated files (and .exe ...) are in a different folder. I didn't use this include very often, that is why i recommended you to split the example code in more files (a .h and a .cpp for that class) and in that case you don't need to include the .moc file

    PS:sorry for double post

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT Creator doesn`t create main.moc.

    Quote Originally Posted by Zlatomir View Post
    i guess that the mingw compiler search for that file only in project folder and can't find it because now the generated files (and .exe ...) are in a different folder.
    That's what we have "-I" compiler directive and DEPENDPATH and INCLUDEPATH qmake variables. It should all work regardless of which platform you use unless you have a broken project file. Otherwise Qt itself wouldn't build.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Zlatomir (12th September 2010)

  4. #3
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT Creator doesn`t create main.moc.

    Wysota, thanks for the information, you are right it's only that "project" that doesn't work (i created a new one and it goes well)

    Looks like the example project builds if we delete the "Release" and "tmp" folders form the project folder "appchooser", the compiler will generate the new ones in the folder "appchooser-build-desktop"

    I still can't understand why in case of separate folders the old ones break the build, but when Qt Creator start to behave "strange" i think the deletion of old build files is what should be done first. Anyway i never had this problem with not finding a moc file because of the old build files.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT Creator doesn`t create main.moc.

    It's not Creator that causes the behaviour - it is just a text editor, nothing more. It's the compiler (drived by (n)make) that decides what to process and how.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 20th April 2010, 21:27
  2. GLib-ERROR **: Cannot create pipe main loop wake-up
    By chenxuelian in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2010, 07:18
  3. Building Qt creator from gitorious main branch
    By eurodatar in forum Installation and Deployment
    Replies: 2
    Last Post: 8th September 2009, 14:20
  4. Resizeable main window in Qt Creator?
    By Lendrick in forum Qt Tools
    Replies: 2
    Last Post: 3rd June 2009, 19:57
  5. Qt Creator doesn't stop at breakpoints
    By TheSaw in forum Qt Tools
    Replies: 3
    Last Post: 12th May 2009, 15:53

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
  •  
Qt is a trademark of The Qt Company.