I have a .pro file in which I link my libraries using:
LIBS += -L$${OUTDIR} \
-lA \
-lB \
-lC \
I have developed three libraries A, B, C and this is the fourth library I am trying to build, call it D. libD.so needs to link with others. Since I am putting everything under a bin directorty, I added -L$${OUTDIR} there so that it will look for the bin folder for finding libraries. OUTDIR is a variable I set equal to that bin dir and I am sure it is the correct directory. I print it as a message. But I get the error that libD.so can't find libB.so. I am confused here, it finds other A and C, why it can't find B? They are all under the same directory and I am adding that to library path using -L$${OUTDIR}, so. What could be the problem?
By the way, If a delete that -L$${OUTDIR} and instead add that directory directly to LD_LIBRARY_PATH, from QtCreator Projects tab and build configurations, it finds all the libraries correctly.