I just came across this as well…
I was compiling a jami
project (dhtnet) and came across an oddity.
It compiled fine until it hit linking, where it failed because:
/usr/bin/ld: warning: libcrypto.so.3, needed by /usr/lib/libsrt.so.1.5, may conflict with libcrypto.so.1.0.0
/usr/bin/ld: /usr/local/lib/libpj-x86_64-unknown-linux-gnu.a(ssl_sock_ossl.o): undefined reference to symbol 'X509_get_version@@OPENSSL_3.0.0'
/usr/bin/ld: /usr/lib/libcrypto.so.3: error adding symbols: DSO missing from command line
But that shouldn’t be, so I traced the cmake setup and saw
/usr/share/cmake/Modules/FindPkgConfig.cmake(302): find_library(pkgcfg_lib_pjproject_ssl NAMES ssl HINTS /usr/local/lib NO_DEFAULT_PATH )
/usr/share/cmake/Modules/FindPkgConfig.cmake(306): find_library(pkgcfg_lib_pjproject_ssl NAMES ssl )
/usr/share/cmake/Modules/FindPkgConfig.cmake(309): mark_as_advanced(pkgcfg_lib_pjproject_ssl )
/usr/share/cmake/Modules/FindPkgConfig.cmake(310): if(pkgcfg_lib_pjproject_ssl )
/usr/share/cmake/Modules/FindPkgConfig.cmake(311): list(APPEND _libs /<pathTo>/STM32CubeProgrammer/bin/libssl.so )
Yeah, some brainwit at ST thought it best to shove libraries in the bin dir.
At the same time, I don’t think find_library
should be going through PATH
for “libraries”.
Once I removed that STM32 bin dir from my PATH, I successfully got:
/usr/share/cmake/Modules/FindPkgConfig.cmake(302): find_library(pkgcfg_lib_pjproject_ssl NAMES ssl HINTS /usr/local/lib NO_DEFAULT_PATH )
/usr/share/cmake/Modules/FindPkgConfig.cmake(306): find_library(pkgcfg_lib_pjproject_ssl NAMES ssl )
/usr/share/cmake/Modules/FindPkgConfig.cmake(309): mark_as_advanced(pkgcfg_lib_pjproject_ssl )
/usr/share/cmake/Modules/FindPkgConfig.cmake(310): if(pkgcfg_lib_pjproject_ssl )
/usr/share/cmake/Modules/FindPkgConfig.cmake(311): list(APPEND _libs **/usr/lib/libssl.so** )
Setting -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=FALSE
results in the root bin dir not being searched AT ALL:
Make Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
I know I can set those but like @elahav was saying, it’s odd/non-sensical for find_library
to seach bin dirs for libs (at least before lib dirs first). It’s the same kind of non-sensical thinking as ST shoving libs into their bin dir.
I believe this to be considered a bug and think it ought to be reported as such, no?