I'm trying to build OpemCV from source, and surround it in Klocwork static code analysis tool. One of the steps is to build the project and invoke kwinject so it will create a file later to be used for analysis. Within the /home/user/opencv_build/opencv/build directory I'm running:
kwinject sudo make
Problem is I get the following error at the beginning of the build:
ERROR: ld.so: object 'libkwinject.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
The .so file is located in 2 locations: /home/ubuntu/klocwork/lib/ix86-pc-linux/libkwinject.so /home/ubuntu/klocwork/lib64/ix86-pc-linux/libkwinject.so
I added the first full path to the LD_PRELOAD variable but I still get the same error mentioned above
I'm using Ubuntu 22.04
I had the same issue and solved it by setting the LD_PRELOAD before running kwinject. In order that in the second step kwbuildproject does not fail I had after to unset it...
This was done on Ubuntu 20.04 and Klocwork 2020.4.