open-quantum-safe / liboqs

C library for prototyping and experimenting with quantum-resistant cryptography
https://openquantumsafe.org/
Other
1.68k stars 414 forks source link

Failure when linking C shared library / tests #1779

Closed mhsm2000 closed 2 months ago

mhsm2000 commented 2 months ago

Hello,

I am currently trying to build the repository with Linux Ubuntu, following the README and am receiving the following error when executing the ninja command:

[662/680] Linking C shared library lib/liboqs.so.0.10.1-dev
FAILED: lib/liboqs.so.0.10.1-dev 
: && /usr/bin/cc -fPIC   -Wl,-z,noexecstack -shared -Wl,-soname,liboqs.so.5 -o lib/liboqs.so.0.10.1-dev @CMakeFiles/oqs.rsp  && :
/usr/bin/ld: /usr/bin/openssl: stdin: invalid version 5 (max 0)
/usr/bin/ld: /usr/bin/openssl: error adding symbols: bad value
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

For the cmake before I used cmake -DBUILD_SHARED_LIBS=ON -GNinja ..

Previous to adding the shared library option I received the same error but for different tests as in e.g. tests/example_kem and others.

I've looked up the error and so far have not found a solution that works or any similar error in the issues on this page. Any help or idea for a solution would be greatly appreciated. Thanks!

Environment:

mhsm2000 commented 2 months ago

Could actually fix it with the solution from the following issue: https://github.com/open-quantum-safe/liboqs/issues/1748