Compiling with "-L /usr/local/lib" option

asked 2020-08-03 09:10:21 -0500

digikar gravatar image

I've a package that makes use of jaegertracing. For this, my issue is that I get the reports only when the file is compiled with "-L /usr/local/lib" option. I've elaborated that issue at https://stackoverflow.com/questions/6... .

Not finding a solution to that yet, I tried to add_compile_options(-L/usr/local/lib) to the CMakeLists.txt of the corresponding package. However, this does not seem to have an effect. I'm concluding the no-effect from - I have tried adding -ljaegertracing -lopentracing -lyaml-cpp to the compile options, but receive a undefined symbol error during run time. OTOH, I added jaegertracing opentracing yaml-cpp to target_link_libraries, and the runtime error disappears.

I also tried to link_libraries(/usr/local/lib) in the cmake file, but don't think that has an effect either (how do I check?), since no traces are collected or a message about tracer initialization is obtained.

Is there another way to achieve the effect of -L/usr/local/lib or any way to debug why add_compile_options might not be working, or some other place I'm missing out?

Thank you!

PS: I'm using nodelets - not sure if that makes any difference.

edit retag flag offensive close merge delete

Comments

Not what you came here to hear, but this sounds like a CMake issue, not a ROS one.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-04 03:18:42 -0500 )edit