2011-09-14 3 views
1

프로젝트에 우리 자신의 네임 스페이스가 있으므로 gtkmm을 사용하여 GUI를 포함하고자합니다.컴파일 문제 sigC++/gtkmm 자신의 네임 스페이스에

void Config::connect_signals() 
{ 
    m_notebook.signal_switch_page().connect(sigc::mem_fun(*this,&Config::on_notebook_switch_page)); 
    m_button_save.signal_clicked().connect(sigc::mem_fun(*this,&Config::on_button_clicked_save)); 
    m_button_close.signal_clicked().connect(sigc::mem_fun(*this,&Config::on_button_clicked_close)); 
} 

우리는 다음 pkg-config --cflags gtkmm-2.4pkg-config --libs gtkmm-2.4를 사용하여 Config.cpp을 컴파일 : 그것은 모든 작동

// in a header file: 
namespace project 
{ 
    // namespace "gui" is declared elsewhere  
    class gui::Config : Gtk::Window 
    { 
     protected: 
      Config(); 

     private: 
      // various Gtk::Widget objects 

      void connect_signals(); 

    }; 
} 

때까지 나는이 방법을 구현하려고합니다.

In file included from /usr/include/sigc++-2.0/sigc++/signal_base.h:29:0, 
     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:83, 
     from /usr/include/gtkmm-2.4/gtkmm.h:87, 
     from include/libproject.h:12, 
     from include/gui/Config.h:4, 
     from src/gui/Config.cpp:1: 
/usr/include/sigc++-2.0/sigc++/type_traits.h: In instantiation of ‘const bool sigc::is_base_and_derived<sigc::trackable, project::gui::Config>::value’: 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1922:26: instantiated from ‘sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>’ 
src/gui/Config.cpp:70:94: instantiated from here 
/usr/include/sigc++-2.0/sigc++/type_traits.h:132:16: error: ‘sigc::trackable’ is an inaccessible base of ‘project::gui::Config’ 
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:9:0, 
     from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7, 
     from /usr/include/sigc++-2.0/sigc++/signal_base.h:31, 
     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:83, 
     from /usr/include/gtkmm-2.4/gtkmm.h:87, 
     from include/libproject.h:12, 
     from include/gui/Config.h:4, 
     from src/gui/Config.cpp:1: 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In instantiation of ‘sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>’: 
src/gui/Config.cpp:70:94: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1922:26: error: ‘sigc::is_base_and_derived<sigc::trackable, project::gui::Config>::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 instantiation of ‘sigc::bound_mem_functor0<void, project::gui::Config>’: 
src/gui/Config.cpp:72:95: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1792:26: error: ‘sigc::is_base_and_derived<sigc::trackable, project::gui::Config>::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_functor2<T_return, T_obj, T_arg1, T_arg2>::bound_mem_functor2(T_obj&, sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::function_type) [with T_return = void, T_obj = project::gui::Config, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int, sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::function_type = void (project::gui::Config::*)(_GtkNotebookPage*, unsigned int)]’: 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:5501:77: instantiated from ‘sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2> sigc::mem_fun(T_obj&, T_return (T_obj2::*)(T_arg1, T_arg2)) [with T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int, T_return = void, T_obj = project::gui::Config, T_obj2 = project::gui::Config]’ 
src/gui/Config.cpp:70:94: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1908:18: error: using invalid field ‘sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::obj_’ 
/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&, sigc::bound_mem_functor0<T_return, T_obj>::function_type) [with T_return = void, T_obj = project::gui::Config, sigc::bound_mem_functor0<T_return, T_obj>::function_type = void (project::gui::Config::*)()]’: 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:5453:61: 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 = project::gui::Config, T_obj2 = project::gui::Config]’ 
src/gui/Config.cpp:72:95: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1780:18: 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_functor2<T_return, T_obj, T_arg1, T_arg2>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_return = void, T_obj = project::gui::Config, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’: 
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:3: instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>]’ 
/usr/include/sigc++-2.0/sigc++/visit_each.h:170:3: 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_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int> >]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:39:7: instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:604:65: instantiated from ‘sigc::slot2<T_return, T_arg1, T_arg2>::slot2(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1184:26: instantiated from ‘sigc::slot<T_return, T_arg1, T_arg2, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’ 
src/gui/Config.cpp:70:95: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1936:3: error: ‘const class sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>’ has no member named ‘obj_’ 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In member function ‘T_return sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::operator()(typename sigc::type_trait<T_arg3>::take, typename sigc::type_trait<T_arg4>::take) const [with T_return = void, T_obj = project::gui::Config, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int, typename sigc::type_trait<T_arg3>::take = _GtkNotebookPage* const&, typename sigc::type_trait<T_arg4>::take = const unsigned int&]’: 
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:103:39: instantiated from ‘typename sigc::adaptor_functor<T_functor>::deduce_result_type<T_arg1, T_arg2>::type sigc::adaptor_functor<T_functor>::operator()(T_arg1, T_arg2) const [with T_arg1 = _GtkNotebookPage* const&, T_arg2 = const unsigned int&, T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, typename sigc::adaptor_functor<T_functor>::deduce_result_type<T_arg1, T_arg2>::type = void]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:173:25: instantiated from ‘static T_return sigc::internal::slot_call2<T_functor, T_return, T_arg1, T_arg2>::call_it(sigc::internal::slot_rep*, typename sigc::type_trait<T_arg3>::take, typename sigc::type_trait<T_arg4>::take) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int, typename sigc::type_trait<T_arg3>::take = _GtkNotebookPage* const&, typename sigc::type_trait<T_arg4>::take = const unsigned int&]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:180:45: instantiated from ‘static void* (* sigc::internal::slot_call2<T_functor, T_return, T_arg1, T_arg2>::address())(void*) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int, void* (*)(void*) = void* (*)(void*)]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:607:7: instantiated from ‘sigc::slot2<T_return, T_arg1, T_arg2>::slot2(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1184:26: instantiated from ‘sigc::slot<T_return, T_arg1, T_arg2, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’ 
src/gui/Config.cpp:70:95: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1917:61: error: using invalid field ‘sigc::bound_mem_functor2<T_return, T_obj, T_arg1, T_arg2>::obj_’ 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1917:61: 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_bind>, T_return = void, T_obj = project::gui::Config]’: 
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:3: instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_functor = sigc::bound_mem_functor0<void, project::gui::Config>]’ 
/usr/include/sigc++-2.0/sigc++/visit_each.h:170:3: 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, project::gui::Config> >]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:39:7: instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:451:65: instantiated from ‘sigc::slot0<T_return>::slot0(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>, T_return = void]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1130:26: 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, project::gui::Config>, T_return = void]’ 
src/gui/Config.cpp:72:96: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1806:3: error: ‘const class sigc::bound_mem_functor0<void, project::gui::Config>’ 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 = project::gui::Config]’: 
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251:21: instantiated from ‘sigc::adaptor_functor<T_functor>::result_type sigc::adaptor_functor<T_functor>::operator()() const [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>, sigc::adaptor_functor<T_functor>::result_type = void]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:103:36: 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, project::gui::Config>, T_return = void]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:110:45: instantiated from ‘static void* (* sigc::internal::slot_call0<T_functor, T_return>::address())(void*) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>, T_return = void, void* (*)(void*) = void* (*)(void*)]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:454:7: instantiated from ‘sigc::slot0<T_return>::slot0(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>, T_return = void]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1130:26: 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, project::gui::Config>, T_return = void]’ 
src/gui/Config.cpp:72:96: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1787:49: error: using invalid field ‘sigc::bound_mem_functor0<T_return, T_obj>::obj_’ 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1787:49: 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_functor2<T_return, T_obj, T_arg1, T_arg2>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, T_return = void, T_obj = project::gui::Config, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’: 
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:3: instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>]’ 
/usr/include/sigc++-2.0/sigc++/visit_each.h:170:3: 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_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int> >]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:60:7: instantiated from ‘static void* sigc::internal::typed_slot_rep<T_functor>::destroy(void*) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:38:52: instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:604:65: instantiated from ‘sigc::slot2<T_return, T_arg1, T_arg2>::slot2(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1184:26: instantiated from ‘sigc::slot<T_return, T_arg1, T_arg2, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>, T_return = void, T_arg1 = _GtkNotebookPage*, T_arg2 = unsigned int]’ 
src/gui/Config.cpp:70:95: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1936:3: error: ‘const class sigc::bound_mem_functor2<void, project::gui::Config, _GtkNotebookPage*, unsigned int>’ has no member named ‘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_unbind>, T_return = void, T_obj = project::gui::Config]’: 
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:3: instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, T_functor = sigc::bound_mem_functor0<void, project::gui::Config>]’ 
/usr/include/sigc++-2.0/sigc++/visit_each.h:170:3: 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, project::gui::Config> >]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:60:7: instantiated from ‘static void* sigc::internal::typed_slot_rep<T_functor>::destroy(void*) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:38:52: instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:451:65: instantiated from ‘sigc::slot0<T_return>::slot0(const T_functor&) [with T_functor = sigc::bound_mem_functor0<void, project::gui::Config>, T_return = void]’ 
/usr/include/sigc++-2.0/sigc++/functors/slot.h:1130:26: 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, project::gui::Config>, T_return = void]’ 
src/gui/Config.cpp:72:96: instantiated from here 
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1806:3: error: ‘const class sigc::bound_mem_functor0<void, project::gui::Config>’ has no member named ‘obj_’ 
make: *** [src/gui/Config.o] Error 1 

문제가 정말 라이브러리하는 sigC에 ++ 또는 그냥 네임 스페이스 문제가 있다면 관련이 있는지 우리는 확실하지 않다 :

컴파일러는 결국 다음과 같은 메시지가 발생합니다. 별도의 파일에 네임 스페이스가없는 동일한 파일을 컴파일 할 때 작동했습니다.

어떤 생각, 감사합니다 감사합니다

답변

2

클래스는 개인적으로

신호가 이러한 인터페이스에 연결을 시도하는 것 같습니다
class gui::Config : public Gtk::Window 

Gtk::Window

class gui::Config : Gtk::Window 

에서 상속되지만한다 액세스 할 수 없습니다.

+0

+1 : 수락 : 작업 파일을 재분석 한 후, 나는 뭔가 빠져있는 것을 보았습니다. 상속 재산;) 그것은 쉽고 논리가 있습니다. 감사! – Atmocreations

0

정의가 제공되는 파일에 세 개의 네임 스페이스를 모두 가져와야합니다.

using namespace project; 
using namespace gui; 
using namespace gtk; 

void Config::connect_signals() 
{ 
    // ... 
} 

그러나 project, gui 네임 스페이스는 중복됩니다. 이미 Config이 네임 스페이스 project에 있습니다. 나는 gui 네임 스페이스가 선언 된 귀하의 의견을 이해하지 못합니다. 이것으로 충분할 것입니다. -

namespace project 
{ 
    class Config : Gtk::Window // The class being inherited is from a different namespace 
    { 
     //... 
+1

a)'네임 스페이스 사용하기 gtk'를 선언하는 것이 나의 의도는 아닙니다. 그리고 나는 그것이 어쨌든'Gtk'이어야한다고 생각합니다. 이것은 동일하지 않습니다 (대소 문자 구별). b) AFAIK 네임 스페이스가 아직 존재하지 않으면'class namespace :: Classname {}; '을 사용하여 클래스를 생성 할 수 없습니다. 어쨌든 고마워 :) – Atmocreations