Skip to content

Compiled failed when g++ try to compile dh.cc #9

@touchinglie

Description

@touchinglie

Env: debian 13 with gcc/g++ make build-essential libssl-dev

After entering the make -C src, the tty showed:

make: Entering directory '/root/willbeinstall/crash/src'
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c server.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c session.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c ssession.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c net.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c misc.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c crashd.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c config.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c pty.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c pty98.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c global.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c log.cc
g++ -Wall -O2 -std=c++11 -pedantic -I/include -DTITLE=""[kthreadd]"" -DNO_DTLS_LISTEN -DHAVE_UNIX98 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c dh.cc
dh.cc: In function ‘int crash::enable_dh(SSL_CTX*)’:
dh.cc:63:33: error: ‘pem_dh’ was not declared in this scope
63 | BIO_new_mem_buf(pem_dh.c_str(), pem_dh.size()),
| ^~~~~~
dh.cc:65:9: error: no matching function for call to ‘std::unique_ptr<bio_st, int ()(bio_st)>::unique_ptr()’
65 | };
| ^
In file included from /usr/include/c++/14/memory:78,
from dh.cc:33:
/usr/include/c++/14/bits/unique_ptr.h:385:9: note: candidate: ‘template<class _Up, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(std::auto_ptr<_Up>&&) [with = _Up; _Tp = bio_st; _Dp = int ()(bio_st)]’
385 | unique_ptr(auto_ptr<_Up>&& __u) noexcept;
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:385:9: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/unique_ptr.h:374:9: note: candidate: ‘template<class _Up, class _Ep, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Ep = _Up; = _Ep; _Tp = bio_st; _Dp = int ()(bio_st)]’
374 | unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:374:9: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/unique_ptr.h:353:19: note: candidate: ‘template<class _Del, class> constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr(std::nullptr_t) [with = _Del; _Tp = bio_st; _Dp = int ()(bio_st)]’
353 | constexpr unique_ptr(nullptr_t) noexcept
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:353:19: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/unique_ptr.h:347:9: note: candidate: ‘template<class _Del, class _DelUnref> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer, std::__enable_if_t<((bool)std::is_lvalue_reference<_Del>::value), _DelUnref&&>) [with _DelUnref = _Del; _Tp = bio_st; _Dp = int ()(bio_st)]’ (deleted)
347 | unique_ptr(pointer,
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:347:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:338:9: note: candidate: ‘template<class _Del, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer, std::__enable_if_t<((bool)(! std::is_lvalue_reference<_Del>::value)), _Del&&>) [with = _Del; _Tp = bio_st; _Dp = int ()(bio_st)]’
338 | unique_ptr(pointer __p,
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:338:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:325:9: note: candidate: ‘template<class _Del, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer, const deleter_type&) [with = _Del; _Tp = bio_st; _Dp = int ()(bio_st)]’
325 | unique_ptr(pointer __p, const deleter_type& __d) noexcept
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:325:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:311:9: note: candidate: ‘template<class _Del, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer) [with = _Del; _Tp = bio_st; _Dp = int ()(bio_st)]’
311 | unique_ptr(pointer __p) noexcept
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:311:9: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/unique_ptr.h:298:19: note: candidate: ‘template<class _Del, class> constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr() [with = _Del; _Tp = bio_st; _Dp = int ()(bio_st)]’
298 | constexpr unique_ptr() noexcept
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:298:19: note: candidate expects 0 arguments, 2 provided
/usr/include/c++/14/bits/unique_ptr.h:360:7: note: candidate: ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = bio_st; _Dp = int ()(bio_st)]’
360 | unique_ptr(unique_ptr&&) = default;
| ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:360:7: note: candidate expects 1 argument, 2 provided
make: *** [Makefile:155: dh.o] Error 1

It seems like the functions' scope problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions