PDA

View Full Version : how to link external library in qt linux?



qtlinuxnewbie
5th March 2010, 06:47
hi,

i want to use a driver API in my app.
so i linked the library in this manner in pro file:L/root/dscud-6.02/libdscud-6.02.a -lpthread -lm
and included the .h file.

i am getting the undefined reference when i call the driver functions:


i want to know whether the error is due to the improper linking of the driver library or
the driver library it self
as i tried from the outside the qt(through a C program). It was sucessful. :confused::confused:
as i am knew to the Qt programming.i am placing this question.

can any one clarify me .

Thakz in advance..

@qtlinuxnewbie.

high_flyer
5th March 2010, 08:32
you have to add the library and library path to the pro file.
Read the qmake documentation on the specifics of how to do it.

qtlinuxnewbie
5th March 2010, 09:11
The problem was solved:
actually that was my mistake:
i placed
-L/root/dscud-6.02/libdscud-6.02.a -lpthread -lm
instead of
-L/root/dscud-6.02/ libdscud-6.02.a -lpthread -lm

@qtlinuxnewbie