-
Notifications
You must be signed in to change notification settings - Fork 229
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
Command is incomplete type #13
Comments
|
Проблема в том, что я не мог создать обьект unique_ptrExecute::Command |
Прочитал, что если есть виртуальный деструктор, то нужно по идее пользоваться shared_ptr, который гарантирует вызов нужного деструктора |
Ты не запостил саму ошибку, но если она совпадает с заколовком, т.е "Command is incomplete type" то проблема изза того, что компилятор не видит реального класса, т.е Второе, |
Все, спасибо, разобрался, моя ошибка, извиняюсь |
In file included from /usr/include/c++/7/memory:80:0,
from /home/delta37/sphere/parallel_programming/afina/include/afina/network/Server.h:4,
from /home/delta37/sphere/parallel_programming/afina/src/network/blocking/ServerImpl.h:8,
from /home/delta37/sphere/parallel_programming/afina/src/network/blocking/ServerImpl.cpp:1:
/usr/include/c++/7/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Afina::Execute::Command]’:
/usr/include/c++/7/bits/unique_ptr.h:268:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Afina::Execute::Command; _Dp = std::default_deleteAfina::Execute::Command]’
/home/delta37/sphere/parallel_programming/afina/src/network/blocking/ServerImpl.cpp:225:40: required from here
/usr/include/c++/7/bits/unique_ptr.h:76:22: error: invalid application of ‘sizeof’ to incomplete type ‘Afina::Execute::Command’
static_assert(sizeof(_Tp)>0,
^
src/network/CMakeFiles/Network.dir/build.make:110: recipe for target 'src/network/CMakeFiles/Network.dir/blocking/ServerImpl.cpp.o' failed
make[2]: *** [src/network/CMakeFiles/Network.dir/blocking/ServerImpl.cpp.o] Error 1
CMakeFiles/Makefile2:742: recipe for target 'src/network/CMakeFiles/Network.dir/all' failed
make[1]: *** [src/network/CMakeFiles/Network.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Я хотел воспользоваться классом парсером, подключил в ServerImpl.h Parser.h И создал обьект Parser но при компиляции выскочила такая ошибка
The text was updated successfully, but these errors were encountered: