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

[C++] Compilation issue #524

Open
laishramrahul opened this issue Aug 17, 2024 · 1 comment
Open

[C++] Compilation issue #524

laishramrahul opened this issue Aug 17, 2024 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@laishramrahul
Copy link

Error compiling silero-vad-onnx.cpp

Error while compliling the c++ version of silero-v5, below is the error message, please help

g++ silero-vad-onnx.cpp -I /home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/ -L /home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/lib/ -lonnxruntime -Wl,-rpath,/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/lib/ -o vad
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33,
from /usr/include/c++/11/bits/allocator.h:46,
from /usr/include/c++/11/string:41,
from /usr/include/c++/11/bits/locale_classes.h:40,
from /usr/include/c++/11/bits/ios_base.h:41,
from /usr/include/c++/11/ios:42,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from silero-vad-onnx.cpp:1:
/usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Ort::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}; _Tp = Ort::Session]’:
/usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Ort::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}; _Tp = Ort::Session; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocatorOrt::Session]’
/usr/include/c++/11/bits/shared_ptr_base.h:519:39: required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}; _Tp = Ort::Session; _Alloc = std::allocatorOrt::Session; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/11/bits/shared_ptr_base.h:650:16: required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = Ort::Session; _Alloc = std::allocatorOrt::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/11/bits/shared_ptr_base.h:1342:14: required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocatorOrt::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}; _Tp = Ort::Session; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/11/bits/shared_ptr.h:409:59: required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocatorOrt::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}; _Tp = Ort::Session]’
/usr/include/c++/11/bits/shared_ptr.h:862:14: required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Ort::Session; _Alloc = std::allocatorOrt::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}]’
/usr/include/c++/11/bits/shared_ptr.h:878:39: required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = Ort::Session; _Args = {Ort::Env&, const wchar_t*, Ort::SessionOptions&}]’
silero-vad-onnx.cpp:117:49: required from here
/usr/include/c++/11/ext/new_allocator.h:162:11: error: no matching function for call to ‘Ort::Session::Session(Ort::Env&, const wchar_t*, Ort::SessionOptions&)’
162 | { ::new((void )__p) _Up(std::forward<_Args>(__args)...); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_api.h:1229,
from silero-vad-onnx.cpp:12:
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_inline.h:604:8: note: candidate: ‘Ort::Session::Session(Ort::Env&, const void
, size_t, const Ort::SessionOptions&)’
604 | inline Session::Session(Env& env, const void* model_data, size_t model_data_length, const SessionOptions& options) {
| ^~~~~~~
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_inline.h:604:8: note: candidate expects 4 arguments, 3 provided
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_inline.h:599:8: note: candidate: ‘Ort::Session::Session(Ort::Env&, const char*, const Ort::SessionOptions&, OrtPrepackedWeightsContainer*)’
599 | inline Session::Session(Env& env, const ORTCHAR_T* model_path, const SessionOptions& options,
| ^~~~~~~
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_inline.h:599:8: note: candidate expects 4 arguments, 3 provided
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_inline.h:595:8: note: candidate: ‘Ort::Session::Session(Ort::Env&, const char*, const Ort::SessionOptions&)’
595 | inline Session::Session(Env& env, const ORTCHAR_T* model_path, const SessionOptions& options) {
| ^~~~~~~
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_inline.h:595:52: note: no known conversion for argument 2 from ‘const wchar_t*’ to ‘const char*’
595 | inline Session::Session(Env& env, const ORTCHAR_T* model_path, const SessionOptions& options) {
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from silero-vad-onnx.cpp:12:
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_api.h:513:12: note: candidate: ‘Ort::Session::Session(std::nullptr_t)’
513 | explicit Session(std::nullptr_t) {} ///< Create an empty Session object, must be assigned a valid one to be used
| ^~~~~~~
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_api.h:513:12: note: candidate expects 1 argument, 3 provided
/home/lrahul/workspace/onnxruntime-linux-x64-1.12.1/include/onnxruntime_cxx_api.h:512:8: note: candidate: ‘Ort::Session::Session(Ort::Session&&)’
512 | struct Session : Base {
| ^~~~~~~

@laishramrahul laishramrahul added the help wanted Extra attention is needed label Aug 17, 2024
@IntendedConsequence
Copy link

Possible solution: #451

@snakers4 snakers4 changed the title ❓ Questions / Help / Support Compilation issue Sep 11, 2024
@snakers4 snakers4 changed the title Compilation issue [C++] Compilation issue Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants