How to link an external library in Qt Creator when LIBS += -L“…” and -l don't seem to work?
-
@Warrior said in How to link an external library in Qt Creator when LIBS += -L“…” and -l don't seem to work?:
or is there a way to fix the symlink issue?
Your current issue is not related to sym-links. Your problem is that the folder you pass via -L does NOT contain the libs. Either put them back to this folder or pass the folder containing the libs via -L.
-
@Warrior
Well you can see for yourself that the listing fromls
does not match the files/directories in your screenshot.My guess is that screenshot does not come from navigating to the same directory. (A screenshot from file manager without proof of what directory is showing is not much use.) So you need to look closely to sort this out....
-
@JonB I totally understand the suspicious discrepancy between the screen shot and the directory listing but I am not trying to be funny and take people's time. They're both from the same path. I think I need to clone the oidn repo in the same directory where my code is and build it there. That can hopefully solve the problem.
-
@Warrior said in How to link an external library in Qt Creator when LIBS += -L“…” and -l don't seem to work?:
They're both from the same path.
No matter what you tell us - no they're not from the same path. Make sure you use the right one and think about e.g. case sensitivity.
-
@SGaist @JonB @jsulm @Christian-Ehrlicher Thank you all. I finally managed to fix the issue. I cloned the repo in the same directory where my code is and built it there. Here's what
ls -lh /home/Warrior/Desktop/pathtracer/oidn/build
shows me now and I can successfully build my code and run it. I cannot believe that things didn't work the first time and symlinks were incorrect/missing:total 51M drwxrwxr-x 4 Warrior Warrior 4.0K Feb 9 10:14 apps -rw-rw-r-- 1 Warrior Warrior 19K Feb 9 10:14 CMakeCache.txt drwxrwxr-x 7 Warrior Warrior 4.0K Feb 9 10:19 CMakeFiles -rw-rw-r-- 1 Warrior Warrior 5.6K Feb 9 10:14 cmake_install.cmake -rw-rw-r-- 1 Warrior Warrior 2.5K Feb 9 10:17 color_ispc_avx2.h -rw-rw-r-- 1 Warrior Warrior 2.5K Feb 9 10:17 color_ispc_avx512skx.h -rw-rw-r-- 1 Warrior Warrior 3.1K Feb 9 10:17 color_ispc.h -rw-rw-r-- 1 Warrior Warrior 2.5K Feb 9 10:17 color_ispc_sse4.h drwxrwxr-x 3 Warrior Warrior 4.0K Feb 9 10:14 common -rw-r--r-- 1 Warrior Warrior 3.3K Feb 9 10:14 CPackConfig.cmake -rw-r--r-- 1 Warrior Warrior 3.7K Feb 9 10:14 CPackSourceConfig.cmake -rw-rw-r-- 1 Warrior Warrior 2.6K Feb 9 10:17 input_reorder_ispc_avx2.h -rw-rw-r-- 1 Warrior Warrior 2.6K Feb 9 10:17 input_reorder_ispc_avx512skx.h -rw-rw-r-- 1 Warrior Warrior 3.1K Feb 9 10:17 input_reorder_ispc.h -rw-rw-r-- 1 Warrior Warrior 2.6K Feb 9 10:17 input_reorder_ispc_sse4.h -rw-rw-r-- 1 Warrior Warrior 41K Feb 9 10:14 libcommon.a -rw-rw-r-- 1 Warrior Warrior 16M Feb 9 10:17 libdnnl.a lrwxrwxrwx 1 Warrior Warrior 24 Feb 9 10:19 libOpenImageDenoise.so -> libOpenImageDenoise.so.0 lrwxrwxrwx 1 Warrior Warrior 28 Feb 9 10:19 libOpenImageDenoise.so.0 -> libOpenImageDenoise.so.1.3.0 -rwxrwxr-x 1 Warrior Warrior 34M Feb 9 10:19 libOpenImageDenoise.so.1.3.0 -rw-rw-r-- 1 Warrior Warrior 37K Feb 9 10:19 libutils.a drwxrwxr-x 2 Warrior Warrior 4.0K Feb 9 10:17 local__core -rw-rw-r-- 1 Warrior Warrior 104K Feb 9 10:14 Makefile drwxrwxr-x 3 Warrior Warrior 4.0K Feb 9 10:14 mkl-dnn -rwxrwxr-x 1 Warrior Warrior 181K Feb 9 10:19 oidnBenchmark -rwxrwxr-x 1 Warrior Warrior 59K Feb 9 10:19 oidnDenoise -rwxrwxr-x 1 Warrior Warrior 882K Feb 9 10:19 oidnTest -rw-r--r-- 1 Warrior Warrior 1.6K Feb 9 10:14 OpenImageDenoiseConfigVersion.cmake -rw-rw-r-- 1 Warrior Warrior 1.5K Feb 9 10:17 output_copy_ispc_avx2.h -rw-rw-r-- 1 Warrior Warrior 1.5K Feb 9 10:17 output_copy_ispc_avx512skx.h -rw-rw-r-- 1 Warrior Warrior 1.9K Feb 9 10:17 output_copy_ispc.h -rw-rw-r-- 1 Warrior Warrior 1.5K Feb 9 10:17 output_copy_ispc_sse4.h -rw-rw-r-- 1 Warrior Warrior 2.5K Feb 9 10:17 output_reorder_ispc_avx2.h -rw-rw-r-- 1 Warrior Warrior 2.5K Feb 9 10:17 output_reorder_ispc_avx512skx.h -rw-rw-r-- 1 Warrior Warrior 3.1K Feb 9 10:17 output_reorder_ispc.h -rw-rw-r-- 1 Warrior Warrior 2.5K Feb 9 10:17 output_reorder_ispc_sse4.h -rw-rw-r-- 1 Warrior Warrior 1.5K Feb 9 10:17 upsample_ispc_avx2.h -rw-rw-r-- 1 Warrior Warrior 1.5K Feb 9 10:17 upsample_ispc_avx512skx.h -rw-rw-r-- 1 Warrior Warrior 1.8K Feb 9 10:17 upsample_ispc.h -rw-rw-r-- 1 Warrior Warrior 1.5K Feb 9 10:17 upsample_ispc_sse4.h drwxrwxr-x 2 Warrior Warrior 4.0K Feb 9 10:17 weights
-
@Warrior said in How to link an external library in Qt Creator when LIBS += -L“…” and -l don't seem to work?:
I finally managed to fix the issue
so please don't forget to mark your post as solved!
-
QMAKE_LFLAGS += "-Wl,-rpath,\'/home/Warrior/Desktop/pathtracer/oidn/build\'"