Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [Solved] Making a DLL and a .lib to work with Qt
Forum Updated to NodeBB v4.3 + New Features

[Solved] Making a DLL and a .lib to work with Qt

Scheduled Pinned Locked Moved 3rd Party Software
11 Posts 2 Posters 3.6k Views 1 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    The error you are getting comes from the linker, not the compiler. You have missing symbols, but the library is correctly found (otherwise it would complaing about missing library).

    My first guess is that you are compiling in 64 bits but linking a 32 bit library.

    (Z(:^

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BlastDV
      wrote on last edited by
      #3

      Hi @sierdzio, thanks for your answer. But actually I’m not… The library comes from a SDK found here http://www.tecno-symbol.com/symbol/lectores_de_codigos/symbol_cs2000/lectores_cs2000.html and I’m using a 32 bit system too.

      I’ve been reading what I think is the .cpp that generates the .dll and it requires some headers that I’m pretty sure I don’t have, but I’m not getting that error yet, I think.

      (8) Just live your life blind like me (8)

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #4

        This is really not about the headers: the compiler has compiled your code without any errors, so it has all the headers it needs.

        This is, as far as I can tell, about linking. If the architecture is not the reason, then maybe (although this is less probable) it's lack of compiler binary compatibility. If you can, check what compiler was used to build that library, then compare it with your compiler. If they differ (MinGW vs. MSVC, or MSVC 2010 vs. MSVC 2008), that might be the problem.

        Even less probable, but possible: the library can be compiled in different ways, by specifying various DEFINES. You need to use the same defines as the builder of that library used to make sure the binary layout of the file is the same.

        (Z(:^

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BlastDV
          wrote on last edited by
          #5

          From the "apidoc" that comes from the SDK itself:

          The CSP DLL runs under Windows ’95 / ‘98 and NT 4.0 operating systems. The DLL was created using MS Visual C/C++ V 5.0 compiler

          I'm using MinGW. So according to you, that might be the problem. I'm pretty sure that .cpp file I mentioned was the source used to compile the .dll, what do you think about building it again? I have never done that but I think it can be done...

          If there a way of fixing this without recompiling the library?

          (8) Just live your life blind like me (8)

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #6

            Woah, that is an oldie :)

            I think a recompilation of the library will be necessary. But maybe others will have some better ideas.

            (Z(:^

            1 Reply Last reply
            0
            • B Offline
              B Offline
              BlastDV
              wrote on last edited by
              #7

              I see... Well, I'll try to recompile it or even use it as a cpp itself (?), while I wait for others responses.

              But almost nobody sees this category, everyone is posting at "General and Desktop.."

              By the way, thanks for your help :)

              (8) Just live your life blind like me (8)

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #8

                I can move it to General and Desktop. I don't know how other people are doing, but I always scan all newly posted posts, regardless of the subforum they are posted to.

                (Z(:^

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  BlastDV
                  wrote on last edited by
                  #9

                  Well actually I didn't know this category existed until I had this question hahaha. So I guess most people without much experience like me, ignores this. But I think is better to leave it here, since not everyone knows about this, so that filter should bring less but better answers.

                  Once I make the library to run, I'll mark the post as Solved.

                  (8) Just live your life blind like me (8)

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    BlastDV
                    wrote on last edited by
                    #10

                    I ended up adapting the libraries to "modern" C++ (since it was written without the concept of classes) by modifying the .h and .cpp files that comes with the SDK and including them among the rest of my code. Everything is working now!

                    I'm marking this as Solved.

                    (8) Just live your life blind like me (8)

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #11

                      Good to know, congratulations :-)

                      (Z(:^

                      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