sogou / workflow

C++ Parallel Computing and Asynchronous Networking Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

在tutorial执行"make"报错"collect2: error: ld returned 1 exit status"

Treston-W opened this issue · comments

[root@f63c524aca91 workflow]# cd tutorial/
[root@f63c524aca91 tutorial]# make
which: no cmake3 in (/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
mkdir -p build.cmake
rm -rf build.cmake/CMakeCache.txt
cd build.cmake && cmake -D CONSUL= -D KAFKA= -D MYSQL= -D REDIS= /root/workflow/tutorial
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib64/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.1.1c")
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /root/workflow/tutorial/build.cmake
make -C build.cmake -f Makefile
make[1]: Entering directory /root/workflow/tutorial/build.cmake' make[2]: Entering directory /root/workflow/tutorial/build.cmake'
make[3]: Entering directory /root/workflow/tutorial/build.cmake' make[3]: Leaving directory /root/workflow/tutorial/build.cmake'
make[3]: Entering directory /root/workflow/tutorial/build.cmake' [ 2%] Building CXX object CMakeFiles/helloworld.dir/tutorial-00-helloworld.cc.o [ 4%] Linking CXX executable /root/workflow/tutorial/helloworld /root/workflow/_lib/libworkflow.so: undefined reference to RSA_pkey_ctx_ctrl'
/root/workflow/_lib/libworkflow.so: undefined reference to SSL_CTX_up_ref' /root/workflow/_lib/libworkflow.so: undefined reference to TLS_client_method'
/root/workflow/_lib/libworkflow.so: undefined reference to TLS_server_method' collect2: error: ld returned 1 exit status make[3]: *** [/root/workflow/tutorial/helloworld] Error 1 make[3]: Leaving directory /root/workflow/tutorial/build.cmake'
make[2]: *** [CMakeFiles/helloworld.dir/all] Error 2
make[2]: Leaving directory /root/workflow/tutorial/build.cmake' make[1]: *** [all] Error 2 make[1]: Leaving directory /root/workflow/tutorial/build.cmake'
make: *** [all] Error 2
[root@f63c524aca91 tutorial]#

你好,看起来机器可能没有装ssl

你好,看起来机器可能没有装ssl

您好,我装了的:
[root@f63c524aca91 build]# openssl version
OpenSSL 1.1.1c 28 May 2019

类似问题也有用户报过。你看看是不是装了两个openssl,导致一些头文件不匹配。

类似问题也有用户报过。你看看是不是装了两个openssl,导致一些头文件不匹配。

您好,我刚刚重新安装了一版openssl,又报这种错了。。。。

CMake Error at /usr/local/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.29/Modules/FindOpenSSL.cmake:682 (find_package_handle_standard_args)
src/CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!
GNUmakefile:15: recipe for target 'base' failed
make: *** [base] Error 1
[root@f63c524aca91 workflow]# cmake

你在workflow项目源码的目录下打开build.cmake,然后尝试cmake -DOPENSSL_ROOT_DIR=/usr/local/xxxxx ..,其中/usr/local/xxxxx改为你当前OpenSSL安装的路径再试试呢?

你在workflow项目源码的目录下打开build.cmake,然后尝试cmake -DOPENSSL_ROOT_DIR=/usr/local/xxxxx ..,其中/usr/local/xxxxx改为你当前OpenSSL安装的路径再试试呢?

谢谢小姐姐,我试一试。另外请问咱们有指定的openssl版本嘛,问题就是出在openssl上

你刚才的版本1.1是没有问题的,但如果你安装了两个openssl,有可能导致编译、链接、你看到的,不一定是同一个。