[Solved] Making a DLL and a .lib to work with Qt
-
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.
-
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.
-
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.
-
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?
-
Woah, that is an oldie :)
I think a recompilation of the library will be necessary. But maybe others will have some better ideas.
-
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 :)
-
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.
-
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.
-
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.
-
Good to know, congratulations :-)