Problem using external library (dlib) in custom module

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HalfTough

I’m writing custom module for my project as I want to use some external libraries, but I have trouble with SCsub and I can’t have much documentation on how to use it.

I managed to add OpenCV by adding env.Append(LIBS=["opencv_core"]) to my SCsub, but when I try the same with dlib I get an error: ```
/usr/local/include/dlib/test_for_odr_violations.h:24: undefined reference to USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_' /usr/local/include/dlib/test_for_odr_violations.h:51: undefined reference to DLIB_VERSION_MISMATCH_CHECK__EXPECTED_VERSION_19_16_0’

it seems that if I were using CMake, I'd have to add `target_link_libraries(my_target dlib::dlib)` but how to handle it in SCsub?
:bust_in_silhouette: Reply From: HalfTough

Solved it. Turns out dlib doesn’t like being anywhere but where all system libraries are. So instead of having my .a file with the project I simply installed dlib-dev and pointed out to system location

module_env.Append(CPPPATH = ['/usr/include'])
module_env.Append(LIBPATH = ['/usr/lib'])