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

failed to compile on ubuntu18.04 #89

Closed
hoody17 opened this issue May 19, 2023 · 2 comments
Closed

failed to compile on ubuntu18.04 #89

hoody17 opened this issue May 19, 2023 · 2 comments

Comments

@hoody17
Copy link

hoody17 commented May 19, 2023

i met the error on ubuntu18.04 with gcc9.4.0: error: no matching function for call to ‘checked_add<size_t>(size_t*, size_t&, long unsigned int&, size_t&)’
here are some details
$make -j4
Scanning dependencies of target fizz
[ 1%] Building CXX object CMakeFiles/fizz.dir/crypto/Utils.cpp.o
[ 2%] Building CXX object CMakeFiles/fizz.dir/crypto/exchange/X25519.cpp.o
[ 3%] Building CXX object CMakeFiles/fizz.dir/crypto/aead/IOBufUtil.cpp.o
[ 4%] Building CXX object CMakeFiles/fizz.dir/crypto/aead/OpenSSLEVPCipher.cpp.o
[ 5%] Building CXX object CMakeFiles/fizz.dir/crypto/aead/AEGISCipher.cpp.o
[ 6%] Building CXX object CMakeFiles/fizz.dir/crypto/signature/Signature.cpp.o
[ 8%] Building CXX object CMakeFiles/fizz.dir/crypto/Hkdf.cpp.o
/home/hudi/fizz/fizz/crypto/aead/OpenSSLEVPCipher.cpp: In function ‘std::unique_ptrfolly::IOBuf fizz::{anonymous}::evpEncrypt(std::unique_ptrfolly::IOBuf&&, const folly::IOBuf*, folly::ByteRange, size_t, bool, size_t, EVP_CIPHER_CTX*, fizz::Aead::AeadOptions)’:
/home/hudi/fizz/fizz/crypto/aead/OpenSSLEVPCipher.cpp:221:36: error: no matching function for call to ‘checked_add<size_t>(size_t*, size_t&, long unsigned int&, size_t&)’
221 | if (!folly::checked_add<size_t>(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^
222 | &totalSize, headroom, inputLength, tagLen)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/hudi/fizz/fizz/crypto/aead/OpenSSLEVPCipher.cpp:10:
/home/hudi/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-7.5.0/folly-2021.05.24.00-3z2pp4h5kxg45jictnzqipj4lqpog7d6/include/folly/lang/CheckedMath.h:27:6: note: candidate: ‘template<class T, class> bool folly::checked_add(T*, T, T)’
27 | bool checked_add(T* result, T a, T b) {
| ^~~~~~~~~~~
/home/hudi/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-7.5.0/folly-2021.05.24.00-3z2pp4h5kxg45jictnzqipj4lqpog7d6/include/folly/lang/CheckedMath.h:27:6: note: template argument deduction/substitution failed:
/home/hudi/fizz/fizz/crypto/aead/OpenSSLEVPCipher.cpp:221:36: note: candidate expects 3 arguments, 4 provided
221 | if (!folly::checked_add<size_t>(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^
222 | &totalSize, headroom, inputLength, tagLen)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 9%] Building CXX object CMakeFiles/fizz.dir/crypto/KeyDerivation.cpp.o
CMakeFiles/fizz.dir/build.make:110: recipe for target 'CMakeFiles/fizz.dir/crypto/aead/OpenSSLEVPCipher.cpp.o' failed
make[2]: *** [CMakeFiles/fizz.dir/crypto/aead/OpenSSLEVPCipher.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/fizz.dir/all' failed
make[1]: *** [CMakeFiles/fizz.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

how can i resolve it?

@sotodel
Copy link

sotodel commented May 23, 2023

How did you end up with a folly build from 2021?

/home/hudi/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-7.5.0/folly-2021.05.24.00-3z2pp4h5kxg45jictnzqipj4lqpog7d6/include/folly/lang/CheckedMath.h:27:6: [...]

The referenced method was added more recently. Might want to build fresh, from scratch.

@sotodel
Copy link

sotodel commented Jun 6, 2023

Closing. Please let us know if you're still seeing problems after ^.

@sotodel sotodel closed this as completed Jun 6, 2023
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

2 participants