We’re trying to scan a C++ project but we’re facing a shared library can not be opened error.
The C++ files are being indexed and the build-wrapper seems to be working ok and producing output.
…/.scannerwork/.sonartmp/8153199736344520861/subprocess: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
We’ve confirmed that the libz.so.1 file is present under /lib and that LD_LIBRARY_PATH=/lib, however, the scanner is still unable to open the file. Any ideas?
Yes, the scanning is performed in an Alpine docker container. So just to be clear, you are saying that both the build stage (where the build-wrapper is produces output) and the scanning step must be carried out within the same docker container?
yes, the analyzer needs to access the files used during the build, system headers and third-party headers are needed to have a good analysis. You can read the documentation page related to C and C++: https://docs.sonarqube.org/latest/analysis/languages/cfamily//