Results 1 to 4 of 4

Thread: How to reuse qmake/make compiled files (.o moc*.o) ? Can it be possible ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to reuse qmake/make compiled files (.o moc*.o) ? Can it be possible ?

    I explain it.
    I have a project with some ui's and some classes, this one uses MYDLL classes.
    I have another project with the same ui's and classes, but I uses the 'dll' classes directly, using a .pri file who has the correct headers and sources.
    ( I use this way to test the functions of my dll classes without compile the whole dll)

    Ok, everytime I compile the project A or project B, I see Myproject1_buil_desktop and Myproject2_build_desktop. I think.... maybe I'm loosing my time because the moc and .o files are the same files ?
    How can I describe the both .pro files to use the .o and moc_*.o files ?
    (Maybe it does not can be possible)
    I expect I have explained my doubt.
    Thanks

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

    Default Re: How to reuse qmake/make compiled files (.o moc*.o) ? Can it be possible ?

    Quote Originally Posted by tonnot View Post
    maybe I'm loosing my time because the moc and .o files are the same files ?
    Maybe they are not?

    How can I describe the both .pro files to use the .o and moc_*.o files ?
    You can create a third project and build all the shared files into a static library and link this library from your remaining two projects.
    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. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to reuse qmake/make compiled files (.o moc*.o) ? Can it be possible ?

    Thanks wy.
    I know I can build a dll, but I'm talking about the files used to have the GUI.
    I have two projects projectA and projectB, one of them are using 'myclasses' throught a DLL, the other uses them directly. I know I cant do anything with the dll elements, but whats about the 'main' files of all gui of my project? This gui is compounded by a few ui files (that are builded trought its .h and .cpp files ). I see moc_files*.o and files*.o in both folders projectA_build_desktop/release and projectB_build_destop/release.
    So the question is 'Can I do something to get some advantage of using the same .o files? (I imagine that compile times are going to be lower) How?
    Thanks

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

    Default Re: How to reuse qmake/make compiled files (.o moc*.o) ? Can it be possible ?

    Quote Originally Posted by tonnot View Post
    I know I can build a dll
    I didn't say anything about a dll. I gave you a precise answer to your question.
    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: 1
    Last Post: 12th February 2011, 17:43
  2. qmake doesn't make a 'make' file
    By elyness in forum Installation and Deployment
    Replies: 1
    Last Post: 4th August 2010, 15:21
  3. Replies: 0
    Last Post: 21st June 2010, 10:59
  4. Replies: 5
    Last Post: 4th December 2007, 18:24
  5. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43

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.