Автор Тема: Eclipse CDT and sigc++  (Прочетена 1531 пъти)

mazzzterZ

  • Напреднали
  • *****
  • Публикации: 37
  • Distribution: Ubuntu
  • Window Manager: Gnome
    • Профил
Eclipse CDT and sigc++
« -: Mar 07, 2010, 21:05 »
Hi!
For a long time I was using code::blocks as IDE on ubuntu but now I decided to test Eclipse CDT. First of all I compiled a simple console application... no problem. Later I tried gtkmm and I compiled an application containing only an empty window... no problem so I decided everythig works. But it didn't I tried connecting a signal but it gives an error. Here is the signal:
Здравейте !
От доста време за програмиране използвамс редата code::blocks, но сега реших да пробвам Eclipse CDT. Първо компилирах едно просто конзолно приложение и нямаше проблеми. После компилирах проста програмка на gtkmm, която само показваше празен прозорец... пак нямаше проблеми, та затова реших, че всичко работи, но като се опитах да вържа сигнал не се получи. Ето сигнала:
Код:
make all 
Building file: ../src/main_form.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/gtkmm-2.4 -I/usr/lib/sigc++-2.0/include -I"/home/mazzzterz/workspace/ps_project/src" -I/usr/include/atkmm-1.6 -I/usr/include/cairomm-1.0 -I/usr/include/gdkmm-2.4 -I/usr/include/giomm-2.4 -I/usr/include/pangomm-1.4 -I/usr/include/sigc++-2.0 -I/usr/include/glibmm-2.4 -O0 -g3 -Wall -c -fmessage-length=0 `pkg-config gtkmm-2.4 --cflags` -MMD -MP -MF"src/main_form.d" -MT"src/main_form.d" -o"src/main_form.o" "../src/main_form.cpp"
In file included from /usr/include/sigc++-2.0/sigc++/signal_base.h:26,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:23,
                 from /usr/include/glibmm-2.4/glibmm/signalproxy.h:13,
                 from /usr/include/glibmm-2.4/glibmm/objectbase.h:23,
                 from /usr/include/glibmm-2.4/glibmm/wrap.h:26,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:25,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:27,
                 from /usr/include/gtkmm-2.4/gtkmm/window.h:7,
                 from /home/mazzzterz/workspace/ps_project/src/main_form.hpp:11,
                 from ../src/main_form.cpp:10:
/usr/include/sigc++-2.0/sigc++/type_traits.h: In instantiation of ‘const bool sigc::is_base_and_derived<sigc::trackable, SDWindow>::value’:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1792:   instantiated from ‘sigc::bound_mem_functor0<void, SDWindow>’
../src/main_form.cpp:59:   instantiated from here
/usr/include/sigc++-2.0/sigc++/type_traits.h:132: error: ‘sigc::trackable’ is an inaccessible base of ‘SDWindow’
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:9,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:28,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:23,
                 from /usr/include/glibmm-2.4/glibmm/signalproxy.h:13,
                 from /usr/include/glibmm-2.4/glibmm/objectbase.h:23,
                 from /usr/include/glibmm-2.4/glibmm/wrap.h:26,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:25,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:27,
                 from /usr/include/gtkmm-2.4/gtkmm/window.h:7,
                 from /home/mazzzterz/workspace/ps_project/src/main_form.hpp:11,
                 from ../src/main_form.cpp:10:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In instantiation of ‘sigc::bound_mem_functor0<void, SDWindow>’:
../src/main_form.cpp:59:   instantiated from here
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1792: error: ‘sigc::is_base_and_derived<sigc::trackable, SDWindow>::value’ is not a valid template argument for type ‘bool’ because it is a non-constant expression
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In constructor ‘sigc::bound_mem_functor0<T_return, T_obj>::bound_mem_functor0(T_obj&, typename sigc::mem_functor0<T_return, T_obj>::function_type) [with T_return = void, T_obj = SDWindow]’:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:5453:   instantiated from ‘sigc::bound_mem_functor0<T_return, T_obj> sigc::mem_fun(T_obj&, T_return (T_obj2::*)()) [with T_return = void, T_obj = SDWindow, T_obj2 = SDWindow]’
../src/main_form.cpp:59:   instantiated from here
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1780: error: using invalid field ‘sigc::bound_mem_functor0<T_return, T_obj>::obj_’
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In function ‘void sigc::visit_each(const T_action&, const sigc::bound_mem_functor0<T_return, T_obj>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_return = void, T_obj = SDWindow]’:
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:   instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::visit_each_type(const T_action&, const T_functor&) [with T_type = sigc::trackable*, T_action = sigc::internal::slot_do_bind, T_functor = sigc::adaptor_functor<sigc::bound_mem_functor0<void, SDWindow> >]::type_limited_action, T_functor = sigc::bound_mem_functor0<void, SDWindow>]’
/usr/include/sigc++-2.0/sigc++/visit_each.h:170:   instantiated from ‘void sigc::visit_each_type(const T_action&, const T_functor&) [with T_type = sigc::trackable*, T_action = sigc::internal::slot_do_bind, T_functor = sigc::adaptor_functor<sigc::bound_mem_functor0<void, SDWindow> >]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:39:   instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:451:   instantiated from ‘sigc::slot0<T_return>::slot0(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1130:   instantiated from ‘sigc::slot<T_return, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
../src/main_form.cpp:59:   instantiated from here
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1806: error: ‘const class sigc::bound_mem_functor0<void, SDWindow>’ has no member named ‘obj_’
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In member function ‘T_return sigc::bound_mem_functor0<T_return, T_obj>::operator()() const [with T_return = void, T_obj = SDWindow]’:
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251:   instantiated from ‘typename sigc::adaptor_functor<T_functor>::result_type sigc::adaptor_functor<T_functor>::operator()() const [with T_functor = sigc::bound_mem_functor0<void, SDWindow>]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:103:   instantiated from ‘static T_return sigc::internal::slot_call0<T_functor, T_return>::call_it(sigc::internal::slot_rep*) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:110:   instantiated from ‘static void* (* sigc::internal::slot_call0<T_functor, T_return>::address())(void*) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:454:   instantiated from ‘sigc::slot0<T_return>::slot0(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1130:   instantiated from ‘sigc::slot<T_return, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
../src/main_form.cpp:59:   instantiated from here
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1787: error: using invalid field ‘sigc::bound_mem_functor0<T_return, T_obj>::obj_’
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1787: error: return-statement with a value, in function returning 'void'
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In function ‘void sigc::visit_each(const T_action&, const sigc::bound_mem_functor0<T_return, T_obj>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, T_return = void, T_obj = SDWindow]’:
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:   instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::visit_each_type(const T_action&, const T_functor&) [with T_type = sigc::trackable*, T_action = sigc::internal::slot_do_unbind, T_functor = sigc::adaptor_functor<sigc::bound_mem_functor0<void, SDWindow> >]::type_limited_action, T_functor = sigc::bound_mem_functor0<void, SDWindow>]’
/usr/include/sigc++-2.0/sigc++/visit_each.h:170:   instantiated from ‘void sigc::visit_each_type(const T_action&, const T_functor&) [with T_type = sigc::trackable*, T_action = sigc::internal::slot_do_unbind, T_functor = sigc::adaptor_functor<sigc::bound_mem_functor0<void, SDWindow> >]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:60:   instantiated from ‘static void* sigc::internal::typed_slot_rep<T_functor>::destroy(void*) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:38:   instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:451:   instantiated from ‘sigc::slot0<T_return>::slot0(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1130:   instantiated from ‘sigc::slot<T_return, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, SDWindow>, T_return = void]’
../src/main_form.cpp:59:   instantiated from here
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1806: error: ‘const class sigc::bound_mem_functor0<void, SDWindow>’ has no member named ‘obj_’
make: *** [src/main_form.o] Error 1

Забелязах, че ако напиша sigc:: и натисна Ctrl + Space, Eclipse не завършва кода автоматично, а пътя съм го задал в настройките. Този проблем го нямам с namespace-овете Gtk или Glib. Пробвах с Cairo и Gdk, но и тях не ги разпознава въпреки, че съм им въвел пътя. Обаче проблеми с тях няма. Например този код се компилира без грешки:
Код:
sigc::signal<void, int> signal;
signal.emit(5);
Gdk::Color color;
Cairo::RefPtr<Cairo::Context> cairo;
Проблема е само когато вързвам сигналите и изаползвам sigc::ptr_fun или sigc::mem_fun. С други не съм пробвал и не знам дали има проблеми.

Edit: Оправих го... грешката беше моя... бях забравил да спомена, че наследявам Gtk::Window public и затова го наследяваше private. Като го оправих се компилира без проблеми
« Последна редакция: Mar 07, 2010, 22:18 от mazzzterZ »
Активен

Подобни теми
Заглавие Започната от Отговора Прегледи Последна публикация
Eclipse
Настройка на програми
kuco 0 1583 Последна публикация Jan 27, 2005, 22:47
от kuco
Eclipse
Общ форум
Martin_Beltov 1 2372 Последна публикация Jun 01, 2005, 10:51
от JOKe
Проблем с eclipse
Общ форум
k0rena 2 2735 Последна публикация Jul 26, 2005, 18:33
от
Въпрос относно - Eclipse ?
Общ форум
radigbg 2 2484 Последна публикация Aug 02, 2009, 16:15
от tyuio
Проблем с Eclipse
Настройка на програми
lidero 7 3805 Последна публикация Nov 08, 2009, 17:16
от tyuio