Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QMAKE: how to protect some *.o files from being erased during clean/distclean?

QMAKE: how to protect some *.o files from being erased during clean/distclean?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 3 Posters 677 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FreedomFighter
    wrote on last edited by
    #1

    I am using QMAKE, and I have a 3rd party *.o file which I don't want to lose during "clean" and "distclean". How do I protect this file?

    The ultimate goal is to build a static *.a library out of that file and a few additional object files (which I don't mind losing).

    On Unix, I do this by changing QMAKE_AR_CMD which is UNIX-specific. On Windows, this doesn't work.

    I would love to have a cross-platform solution for this.

    Any help?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Where does these file come from ? Are you building that 3party library ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FreedomFighter
        wrote on last edited by
        #3

        Hi SGaist,

        Thanks for welcoming me - The *.o file was given to me by the 3rd party library vendor. I don't have the source code for this library, so this object file is all I have. I obviously wouldn't want that file deleted during cleanup.

        I have a few additional object files, but those come from my own code. These other *.o files should be cleaned up, but not the 3rd party one.

        Many thanks.

        1 Reply Last reply
        0
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #4

          So what you need is a custom link stage under the project file; something that references the external object .o files. I'd generally store them outside of the project folder tree, and create a project file that knows how to find them.

          see https://stackoverflow.com/questions/4644643/how-to-add-object-files-to-a-project-in-qt

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved