2

I use LIBS flag to link qwt library to my project. So in .pro of my project i have

LIBS += -L/home/Desktop/qwt-6.0.1/lib -lqwt

But anyway Qt does not recognize qwt classes. What i'm missing ??

  • Is this an error with compiling or linking? It would help if you edited your question to include your error message. – Clare Macrae Mar 18 '12 at 21:41
  • no , when i try to type a class it just saying that cannot find such class –  Mar 18 '12 at 21:43
  • Does your IDE simply indicate no such class is found, or do you get a compile/link error? Please show us the exact error your getting. – Bart Mar 18 '12 at 21:56
  • it's simply indicate no such class is found. –  Mar 18 '12 at 21:58

2 Answers2

2

I think you forgot to include the headers.

Try to add the following

INCLUDE += /home/Desktop/qwt-6.0.1/include
kechap
  • 2,077
  • 6
  • 28
  • 50
0

I had same problem. you have to use -L switch and set your library path as bellow:

LIBS+= -L "/home/Desktop/qwt-6.0.1/lib/" -lqwt

adding above line to the .pro file resolve compiling error of the project. then for running Application you should link libqwt.so.6.1.3 to default library path on your system using bellow command:

ln -s /home/Desktop/qwt-6.0.1/lib/libqwt.so.6.1.3 /usr/lib/libqwt.so.6

or simply update LD_LIBRARY_PATH using below command:

export LD_LIBRARY_PATH=/home/Desktop/qwt-6.0.1/lib/lib:$LD_LIBRARY_PATH

I advice you to use the first approach.

A.Ajorian
  • 139
  • 1
  • 8