PDA

View Full Version : How to add a .lib in Qt creator 2.3.1



satiz01bravo
10th April 2015, 04:52
I have tried adding my .lib file in .pro but it is not working properly, i can't access the functions which is defined in the library. I am working in windows platform. I am getting the following run time error(while building i am not getting any error) as shown in screenshot.

11064

Sathish.

anda_skoa
10th April 2015, 07:09
If you are not getting a build error, then the lib was properly added.

Cheers,
_

satiz01bravo
10th April 2015, 08:30
@anda_skoa

But i can't access the functions defined in .lib, thats the main issue. So, can i take it as .lib file is corrupted?

Sathish.

yeye_olive
10th April 2015, 09:22
What do you mean by "i can't access the functions defined in .lib"? What happens if you try to compile, run, and debug a call to a function of the library?
The message you get looks like an ordinary log message printed by a function when one of its preconditions is false. What does line 247 of ftdi_infra.c do? What "expression" could possibly be NULL when another value was expected?

anda_skoa
10th April 2015, 09:35
But i can't access the functions defined in .lib, thats the main issue. So, can i take it as .lib file is corrupted?


You couldn't get a runtime error if you couldn't access a function defined in a lib because it would not have built and there would be nothing to run.

The fact that you are able to start the program implies that the library was linked correctly, all symbols needed from it properly resolved.

Cheers,
_

satiz01bravo
10th April 2015, 10:02
@yeye_olive
That statement comes from .lib so i can't check it manually, because i don't have the source code for that specific library.

Note:
If i use this .lib in Microsoft Visual C++ 6.0 i can able to access that function, so is there any compatibility issue from VCC to Qt?

yeye_olive
10th April 2015, 10:14
Have you tried searching the Web for the error message you got? I did, and I found something that looks relevant:
http://stackoverflow.com/questions/20156099/null-expression-encountered-on-ftdis-libmpsse
Have you read the documentation of the library and made sure you use it correctly?

satiz01bravo
10th April 2015, 10:36
@yeye_olive
Thanks for your effort, i too did that, but as i mentioned in my comment #1 i am working in windows platform, i have read the documentation of the library i found only details about the functions defined & OS platforms supportable. In that it is mentioned that it can be used both in windows and linux.

Sathish.

yeye_olive
10th April 2015, 10:50
The stack overflow answer suggests that the error message is caused by a missing runtime dependency. Have you tried putting the required DLL files in the same directory as your .exe file?

anda_skoa
10th April 2015, 10:52
Thanks for your effort, i too did that, but as i mentioned in my comment #1 i am working in windows platform

The StackOverflow discussion says this error is typical for when the library can't find its plugin.
Have you checked that you have the respective DLL (since you are on Windows) in the directory of the application executable or in PATH?

Cheers,
_

satiz01bravo
10th April 2015, 11:00
@ anda_skoa
Yes, i have included .dll file in the path but still the problem persist, i also do have .a file but i don't have any idea what it will do and what is it for??

Should i add .dll manually that means in .pro file should i have to give the link separately??

Sathish.