April 6, 2011

aureshinite aureshinite
Lab Rat
61 posts

Linked library not found at compilation.

 

Hi, I have a project where the structure is basically:

root
—myprojects
——project1
——…
——projectn
—3rdparty
——party1
———include -> headers only
———lib ->ddl, .a lib
——party2
———party2.pro -> compilable project

Inside project1.pro, I want to include qwt. so I have something like :

  1. QWT_PROJECT_DIR = $${TOOLBOX_ROOT}/$${QWT_DIR}
  2.  
  3. INCLUDEPATH += $${QWT_PROJECT_DIR}/include/
  4.  
  5. win32{
  6.     win32-g++{
  7.         LIBS  += -L$${QWT_PROJECT_DIR}/lib/ -lqwtd5
  8.     }
  9.     else{
  10. #MSVC
  11.         LIBS  += $${QWT_PROJECT_DIR}/lib/qwtd5.lib
  12.     }
  13. }
  14. else{
  15.         LIBS  += -L$${QWT_PROJECT_DIR}/lib/ -lqwtd5
  16. }

On one side I can find the h. files, meaning that they are well resolved but on the other side,
I got a “cannot find -lqwtd5”

Do somebody know why is that??
In general, I want to be able to compile each one of my projects without copying the libraries everywhere.

2 replies

April 6, 2011

aureshinite aureshinite
Lab Rat
61 posts

Never mind, found the solution.
For some reasons, when adding a new lib directory with LIBS +=, you need
to insert the complete path while INCLUDEPATH work with relative paths as ../../include

April 7, 2011

Andre Andre
Area 51 Engineer
6076 posts

INCLUDEPATH, as documented [doc.qt.nokia.com], is for including header files. I think you were looking for VPATH and/or DEPENDPATH.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

 
  ‹‹ check platform on .pro [Solved]      Customizing QDial ››

You must log in to post a reply. Not a member yet? Register here!