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. Including MASM .asm file
Forum Updated to NodeBB v4.3 + New Features

Including MASM .asm file

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.9k Views 2 Watching
  • 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.
  • R Offline
    R Offline
    remcopoelstra
    wrote on last edited by
    #1

    Hi,

    I'm trying to create a QT project which links to a .lib created in Visual Studio. That library has a reference to '_alldiv', which seems to be provided by lldiv.asm (in the VS redistributable package). That asm file looks like a file MASM would understand.
    How can I include that asm file in my project so that the reference for the library gets satisfied when linking the whole project?

    Thanks in advance.

    Kind regards,

    Remco Poelstra

    raven-worxR jsulmJ 2 Replies Last reply
    0
    • R remcopoelstra

      Hi,

      I'm trying to create a QT project which links to a .lib created in Visual Studio. That library has a reference to '_alldiv', which seems to be provided by lldiv.asm (in the VS redistributable package). That asm file looks like a file MASM would understand.
      How can I include that asm file in my project so that the reference for the library gets satisfied when linking the whole project?

      Thanks in advance.

      Kind regards,

      Remco Poelstra

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @remcopoelstra
      did you try to add it to SOURCES like any other cpp file?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      R 1 Reply Last reply
      0
      • R remcopoelstra

        Hi,

        I'm trying to create a QT project which links to a .lib created in Visual Studio. That library has a reference to '_alldiv', which seems to be provided by lldiv.asm (in the VS redistributable package). That asm file looks like a file MASM would understand.
        How can I include that asm file in my project so that the reference for the library gets satisfied when linking the whole project?

        Thanks in advance.

        Kind regards,

        Remco Poelstra

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @remcopoelstra So, you link against an already built library? Then why does it need an assembler file?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • raven-worxR raven-worx

          @remcopoelstra
          did you try to add it to SOURCES like any other cpp file?

          R Offline
          R Offline
          remcopoelstra
          wrote on last edited by
          #4

          @raven-worx Adding it to the SOURCES gives the following warning/error:

          :-1: warning: ..\FUM\lldiv.asm: linker input file unused because linking not done
          :-1: error: error: debug/lldiv.o: No such file or directory

          Adding it to LIBS instead gives an 'file format not recognized' error.

          @jsulm I don't know. Probably the provider of the lib doesn't know either. I asked them for another version, but they are most likely going to respond with 'use Visual Studio'.

          raven-worxR 1 Reply Last reply
          0
          • R remcopoelstra

            @raven-worx Adding it to the SOURCES gives the following warning/error:

            :-1: warning: ..\FUM\lldiv.asm: linker input file unused because linking not done
            :-1: error: error: debug/lldiv.o: No such file or directory

            Adding it to LIBS instead gives an 'file format not recognized' error.

            @jsulm I don't know. Probably the provider of the lib doesn't know either. I asked them for another version, but they are most likely going to respond with 'use Visual Studio'.

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            @remcopoelstra
            ok.
            i haven't tried it, but add this to your .pro file:

            win32:msvc {
                my_asm.output  = ${OBJECTS_DIR}/${QMAKE_FILE_BASE}.obj
                my_asm.variable_out = OBJECTS
                my_asm.input = ASM_FILES
            
                !contains(QMAKE_TARGET.arch, x86_64) {
                    my_asm.commands = ml /c /Fo${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
                } else {
                    my_asm.commands = ml64 /c /Fo${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
                }
            
                QMAKE_EXTRA_COMPILERS += my_asm
            }
            

            Then all you need to do is ASM_FILES += path/to/file.asm

            Hope it works.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            R 1 Reply Last reply
            0
            • raven-worxR raven-worx

              @remcopoelstra
              ok.
              i haven't tried it, but add this to your .pro file:

              win32:msvc {
                  my_asm.output  = ${OBJECTS_DIR}/${QMAKE_FILE_BASE}.obj
                  my_asm.variable_out = OBJECTS
                  my_asm.input = ASM_FILES
              
                  !contains(QMAKE_TARGET.arch, x86_64) {
                      my_asm.commands = ml /c /Fo${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
                  } else {
                      my_asm.commands = ml64 /c /Fo${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
                  }
              
                  QMAKE_EXTRA_COMPILERS += my_asm
              }
              

              Then all you need to do is ASM_FILES += path/to/file.asm

              Hope it works.

              R Offline
              R Offline
              remcopoelstra
              wrote on last edited by
              #6

              @raven-worx Thanks for the suggestion. I couldn't get it to work though. It seems this whole part gets ignored as I see no related output in the compile output window.
              I did however notice that there are a lot of these errors in that window:
              Warning: corrupt .drectve at end of def file
              Further Googling showed that the mingw compiler is absolutely not compatible with VS libraries, so it seems I'm on a dead end anyway...

              raven-worxR 1 Reply Last reply
              0
              • R remcopoelstra

                @raven-worx Thanks for the suggestion. I couldn't get it to work though. It seems this whole part gets ignored as I see no related output in the compile output window.
                I did however notice that there are a lot of these errors in that window:
                Warning: corrupt .drectve at end of def file
                Further Googling showed that the mingw compiler is absolutely not compatible with VS libraries, so it seems I'm on a dead end anyway...

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by raven-worx
                #7

                @remcopoelstra said in Including MASM .asm file:

                Further Googling showed that the mingw compiler is absolutely not compatible with VS libraries, so it seems I'm on a dead end anyway...

                well ... don't you think that the fact that you are using mingw instead of MSVC would be a valuable information beforehand?!
                You never mentioned mingw... of course MSVC and mingw libs are not compatible. Not even libs compiled with different MSVC versions are compatible.

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                3

                • Login

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