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

compile error #17

Open
mochechan opened this issue Oct 21, 2022 · 3 comments
Open

compile error #17

mochechan opened this issue Oct 21, 2022 · 3 comments

Comments

@mochechan
Copy link

How to solve compile error for oatpp-libressl in this case?

~/oatpp-libressl/build$ make
[  8%] Building CXX object src/CMakeFiles/oatpp-libressl.dir/oatpp-libressl/Callbacks.cpp.o
[ 16%] Building CXX object src/CMakeFiles/oatpp-libressl.dir/oatpp-libressl/Config.cpp.o
[ 25%] Building CXX object src/CMakeFiles/oatpp-libressl.dir/oatpp-libressl/Connection.cpp.o
[ 33%] Building CXX object src/CMakeFiles/oatpp-libressl.dir/oatpp-libressl/client/ConnectionProvider.cpp.o
[ 41%] Building CXX object src/CMakeFiles/oatpp-libressl.dir/oatpp-libressl/server/ConnectionProvider.cpp.o
[ 50%] Building CXX object src/CMakeFiles/oatpp-libressl.dir/oatpp-libressl/TLSObject.cpp.o
[ 58%] Linking CXX static library liboatpp-libressl.a
[ 58%] Built target oatpp-libressl
[ 66%] Building CXX object test/CMakeFiles/module-tests.dir/oatpp-libressl/tests.cpp.o
[ 75%] Building CXX object test/CMakeFiles/module-tests.dir/oatpp-libressl/FullTest.cpp.o
[ 83%] Building CXX object test/CMakeFiles/module-tests.dir/oatpp-libressl/FullAsyncTest.cpp.o
[ 91%] Building CXX object test/CMakeFiles/module-tests.dir/oatpp-libressl/FullAsyncClientTest.cpp.o
[100%] Linking CXX executable module-tests
../src/liboatpp-libressl.a(Callbacks.cpp.o): In function `oatpp::libressl::Callbacks::setDefaultCallbacks()':
Callbacks.cpp:(.text+0x10): undefined reference to `CRYPTO_set_locking_callback'
../src/liboatpp-libressl.a(Callbacks.cpp.o): In function `oatpp::libressl::Callbacks::createLocks()':
Callbacks.cpp:(.text+0x30): undefined reference to `CRYPTO_num_locks'
../src/liboatpp-libressl.a(ConnectionProvider.cpp.o): In function `oatpp::libressl::client::ConnectionProvider::ConnectionProvider(std::shared_ptr<oatpp::libressl::Config> const&, std::shared_ptr<oatpp::network::ClientConnectionProvider> const&)':
ConnectionProvider.cpp:(.text+0x4a8): undefined reference to `CRYPTO_get_locking_callback'
../src/liboatpp-libressl.a(ConnectionProvider.cpp.o): In function `oatpp::libressl::client::ConnectionProvider::ConnectionProvider(std::shared_ptr<oatpp::libressl::Config> const&, std::shared_ptr<oatpp::network::ClientConnectionProvider> const&)':
ConnectionProvider.cpp:(.text+0x834): undefined reference to `CRYPTO_get_locking_callback'
collect2: error: ld returned 1 exit status
test/CMakeFiles/module-tests.dir/build.make:152: recipe for target 'test/module-tests' failed
make[2]: *** [test/module-tests] Error 1
CMakeFiles/Makefile2:141: recipe for target 'test/CMakeFiles/module-tests.dir/all' failed
make[1]: *** [test/CMakeFiles/module-tests.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
@EnderTheCoder
Copy link

I also have this issue. This happens on one of my servers, but nothing wrong happens on another. So weird.
They are both running Ubuntu Server 22.04 and have installed the same version of Libressl(3.6.1).
Please fix this.

@mochechan
Copy link
Author

It seems like a linking error, rather than a compiling error.
This problem is not yet solved. I am keeping searching solutions.

@gino0717
Copy link

I add following define in Callbacks.cpp in oatpp-libressl/src/ folder

#define CRYPTO_num_locks()            (1)
#define CRYPTO_set_locking_callback(func)
#define CRYPTO_get_locking_callback()         (NULL)
#define CRYPTO_set_add_lock_callback(func)
#define CRYPTO_get_add_lock_callback()        (NULL)

re-compiled the oatpp-libressl.a file and seems worked.

It seems the whole oatpp project uses some out-of-date ssl api and didn't match up modern ssl header.

there are also some similar issues in oatpp-openssl.

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