链接器找不到已安装的软件包

链接器找不到已安装的软件包

我正在尝试关注指示在 Ubuntu 18.04 上安装 FAST-DDS。在 make -j$(nproc --all) 期间,我收到此错误

[  4%] Built target fastcdr
[  5%] Linking CXX shared library libfastrtps.so
/usr/bin/ld: cannot find -lOpenSSL::SSL
/usr/bin/ld: cannot find -lOpenSSL::Crypto
collect2: error: ld returned 1 exit status
src/cpp/CMakeFiles/fastrtps.dir/build.make:4047: recipe for target 'src/cpp/libfastrtps.so.1.8.2' failed
make[2]: *** [src/cpp/libfastrtps.so.1.8.2] Error 1
CMakeFiles/Makefile2:1054: recipe for target 'src/cpp/CMakeFiles/fastrtps.dir/all' failed
make[1]: *** [src/cpp/CMakeFiles/fastrtps.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

Openssl 存在于我的系统中,OpenSSL 1.1.1 11 Sep 2018libssl-dev 也在那里, libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.9).

我该如何解决这个问题?

这里是/构建/Makefile并完成终端输出

答案1

Ubuntu 18.04:Fast-DDS 的 Git 版本没有问题。(我的 cmake 版本是 3.16.3:memory需要 cmake => 3.11)

sudo apt install libasio-dev libtinyxml2-dev 

git clone https://github.com/foonathan/memory.git
cd memory/ && mkdir build && cd build/
cmake .. && make && sudo make install
    
git clone https://github.com/eProsima/Fast-DDS.git
cd Fast-DDS/
git submodule update --init --recursive

cd thirdparty/fastcdr/ && mkdir build && cd build/
cmake .. && make && sudo make install && exit

cd Fast-DDS/ && mkdir build && cd build/
cmake ..
make                    ## No errors
[ 99%] Built target fastrtps
Scanning dependencies of target fast-discovery-server
[ 99%] Building CXX object tools/fds/CMakeFiles/fast-discovery-server.dir/server.cpp.o
[100%] Linking CXX executable fast-discovery-server-1.0.0
[100%] Built target fast-discovery-server
sudo make install        ## No errors

相关内容