Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.2.0 generate single .o file

Qt 5.2.0 generate single .o file

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 1.7k 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.
  • I Offline
    I Offline
    iamnp
    wrote on last edited by
    #1

    Now Qt generates one .o file per every .cpp file in my project. Can I force it to generate only one huge .o file? Or can I convert multiple .o files in a single one using some utils?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bootchk
      wrote on last edited by
      #2

      Why does it matter? Isn't that normal behaviour? Aren't the .o files temporary, that the linker will use to create one big .exe file?

      1 Reply Last reply
      0
      • I Offline
        I Offline
        iamnp
        wrote on last edited by
        #3

        The reason why I am doing that is because I want to compile a signle exe (no dlls) but LGPL requires that statically linked programs must be provided with it's object files. I want to provide only one huge object file.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bootchk
          wrote on last edited by
          #4

          Then make an archive (which is one big file.)

          Or is your goal to obfuscate?

          Why no dll's, i.e. not dynamic linking? If you used dynamic linking, couldn't you provide your code as one big library?

          1 Reply Last reply
          0
          • I Offline
            I Offline
            iamnp
            wrote on last edited by
            #5

            If I was using dlls I would't have provide any source code

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bootchk
              wrote on last edited by
              #6

              I'm not sure I understand. Under the LGPL, the source for the LGPL libraries (say Qt) must only be available, upon request from you or from other repositories. You don't have to ship (or even provide?) the source for the LGPL. You need not provide your proprietary code in source form, only in a form (say a library or object files) that can be linked with modified LGPL libraries.

              I think the terminology used is 'convey.' All you have to do is say precisely which LGPL libraries you used and how a user can get the source. Then the user can modify the LGPL libraries and relink with your library.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MarianMMX
                wrote on last edited by
                #7

                Create huge.cpp with:
                @
                #include "main.cpp"
                #include "file1.cpp"
                #include "filen.cpp"
                @

                and then compile:
                @
                gcc -c huge.cpp
                @

                1 Reply Last reply
                0

                • Login

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