Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling with Ubuntu 18.04.4 LTS and OpenSSL 1.1.1 #19

Open
luo4neck opened this issue Apr 7, 2020 · 3 comments
Open

Error compiling with Ubuntu 18.04.4 LTS and OpenSSL 1.1.1 #19

luo4neck opened this issue Apr 7, 2020 · 3 comments

Comments

@luo4neck
Copy link

luo4neck commented Apr 7, 2020

Hi I want to use this library but got this error during installation, any idea?

[ 47%] Built target cppcommon
Scanning dependencies of target cppserver
[ 47%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/ssl_client.cpp.o
[ 48%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/tcp_client.cpp.o
[ 48%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/ssl_server.cpp.o
[ 47%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/service.cpp.o
[ 48%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/ssl_context.cpp.o
[ 49%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/tcp_resolver.cpp.o
[ 50%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/ssl_session.cpp.o
[ 50%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/tcp_server.cpp.o
[ 50%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/tcp_session.cpp.o
/home/qiyuan/Downloads/CppServer/source/server/asio/service.cpp: In static member function ‘static void CppServer::Asio::Service::ServiceThread(const std::shared_ptr<CppServer::Asio::Service>&, const std::shared_ptr<asio::io_context>&)’:
/home/qiyuan/Downloads/CppServer/source/server/asio/service.cpp:218:5: error: ‘OPENSSL_thread_stop’ was not declared in this scope
     OPENSSL_thread_stop();
     ^~~~~~~~~~~~~~~~~~~
/home/qiyuan/Downloads/CppServer/source/server/asio/service.cpp:218:5: note: suggested alternative: ‘OPENSSL_realloc’
     OPENSSL_thread_stop();
     ^~~~~~~~~~~~~~~~~~~
     OPENSSL_realloc
[ 51%] Building CXX object CMakeFiles/cppserver.dir/source/server/asio/timer.cpp.o
CMakeFiles/cppserver.dir/build.make:62: recipe for target 'CMakeFiles/cppserver.dir/source/server/asio/service.cpp.o' failed
make[2]: *** [CMakeFiles/cppserver.dir/source/server/asio/service.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:899: recipe for target 'CMakeFiles/cppserver.dir/all' failed
make[1]: *** [CMakeFiles/cppserver.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
@esppat
Copy link

esppat commented Apr 20, 2020

Hi,

Did the ./unix.sh command wrote something like

-- OpenSSL version: 1.1.1 /usr/include /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so

at the beginning of its output?
I got this above line and everything is compiling fine in my case

@luo4neck
Copy link
Author

luo4neck commented Apr 20, 2020

hi @esppat
yes openssl 1.1.1 was found during installation, and I figured it out finally that this compilation issue was caused by some symlink issue

But got some trouble to use https client, so decided to use other library now

@championbarca
Copy link

I was also facing the same issue. Issue is due to linking -lssl -lcrypto before other libraries, just in sequence of linking.
Moving list(APPEND LINKLIBS ${OPENSSL_LIBRARIES}) below list(APPEND LINKLIBS cppserver), should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants