Problem mit libsigc++



  • Bisher hat das immer anstandslos kompiliert, nur plötzlich hab ich Fehlermeldungen aus denen ich nicht ganz schlau werde:

    1>------ Erstellen gestartet: Projekt: NLSandbox, Konfiguration: Debug Win32 ------
    1>Kompilieren...
    1>NLApplication.cpp
    1>D:\Source\NightLight\include\sigc++/functors/slot.h(172) : error C2059: Syntaxfehler: 'template'
    1> D:\Source\NightLight\include\sigc++/functors/slot.h(169): Bei der Kompilierung der Klassen-template der void sigc::internal::slot_call2<T_functor,T_return,T_arg1,T_arg2>::call_it(sigc::internal::slot_rep *,const unsigned char &,const bool &)-Memberfunktion
    1> with
    1> [
    1> T_functor=sigc::bound_mem_functor2<void,NightLight::NLApplication,NightLight::u8,bool>,
    1> T_return=void,
    1> T_arg1=const NightLight::u8,
    1> T_arg2=const bool
    1> ]
    1> D:\Source\NightLight\include\sigc++/functors/slot.h(607): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "sigc::internal::slot_call2<T_functor,T_return,T_arg1,T_arg2>".
    1> with
    1> [
    1> T_functor=sigc::bound_mem_functor2<void,NightLight::NLApplication,NightLight::u8,bool>,
    1> T_return=void,
    1> T_arg1=const NightLight::u8,
    1> T_arg2=const bool
    1> ]
    1> D:\Source\NightLight\include\sigc++/functors/slot.h(1183): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "sigc::slot2<T_return,T_arg1,T_arg2>::slot2<T_functor>(const T_functor &)".
    1> with
    1> [
    1> T_return=void,
    1> T_arg1=const NightLight::u8,
    1> T_arg2=const bool,
    1> T_functor=sigc::bound_mem_functor2<void,NightLight::NLApplication,NightLight::u8,bool>
    1> ]
    1> .\NLApplication.cpp(55): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "sigc::slot<T_return,T_arg1,T_arg2>::slot<sigc::bound_mem_functor2<T_return,T_obj,NightLight::u8,bool>>(const T_functor &)".
    1> with
    1> [
    1> T_return=void,
    1> T_arg1=const NightLight::u8,
    1> T_arg2=const bool,
    1> T_obj=NightLight::NLApplication,
    1> T_functor=sigc::bound_mem_functor2<void,NightLight::NLApplication,NightLight::u8,bool>
    1> ]
    1>D:\Source\NightLight\include\sigc++/functors/slot.h(172) : error C2951: template-Deklarationen sind nur im globalen, Namespace- oder Klassengültigkeitsbereich zulässig.
    1>Das Buildprotokoll wurde unter "file://D:\Source\NightLight\obj\NLSandbox\Debug\BuildLog.htm" gespeichert.
    1>NLSandbox - 2 Fehler, 0 Warnung(en)
    ========== Erstellen: 0 erfolgreich, Fehler bei 1, 1 aktuell, 0 übersprungen ==========

    Folgende Typedefs und Macros:

    /// \brief Key-Event-Slot
        typedef sigc::slot<void, const u8, const bool> NLKeySlot;
    
        /// \brief Key-Event
        // true if down
        typedef sigc::signal<void, const u8, const bool> NLKeyEvent;
    
        /// \brief Mouse-Event-Slot
        typedef sigc::slot<void, const f32, const f32, const u8, const bool> NLMouseSlot;
    
        /// \brief Mouse-Event
        // true if down
        typedef sigc::signal<void, const f32, const f32, const u8, const bool> NLMouseEvent;
    
        /// \brief Render Event-Slot
        typedef sigc::slot<void, const u32> NLRenderSlot;
    
        /// \brief Render Event
        typedef sigc::signal<void, const u32> NLRenderEvent;
    
        /// \brief Quit-Event. Is fired when the application quits.
        typedef sigc::signal<bool> NLQuitEvent;
    
        /// \brief Quit-Slot.
        typedef sigc::slot<bool> NLQuitSlot;
    
    /*!
     * \def NLBindKeySlot(CNAME, FNAME)
     * \brief Use this macro to bind your method as callback for the KeyEvent.
     * \param CNAME The name of the class holding the callback.
     * \param FNAME The Name of the function which represents the callback.
     */
    #define NLBindKeySlot(CNAME, FNAME) \
        NLIWindow::NLKeySlot(sigc::mem_fun(this, &CNAME::FNAME))
    
    /**
     * \brief Use this macro to bind your method as callback for the MouseMove-Event.
     * \param CNAME The name of the class holding the callback.
     * \param FNAME The Name of the function which represents the callback.
     */
    #define NLBindMouseSlot(CNAME, FNAME) \
       NLIWindow::NLMouseSlot(sigc::mem_fun(this, &CNAME::FNAME))
    
    /**
     * \brief Use this macro to bind your method as callback for the Render-Event.
     * \param CNAME The name of the class holding the callback.
     * \param FNAME The Name of the function which represents the callback.
     */
    #define NLBindRenderSlot(CNAME, FNAME) \
        NLIWindow::NLRenderSlot(sigc::mem_fun(this, &CNAME::FNAME))
    

    Verwendung:

    window.connectSignal(NLBindKeySlot(NLApplication, onKey));
        window.connectSignal(NLBindRenderSlot(NLApplication, onRender));
        window.connectSignal(NLBindQuitSlot(NLApplication, onQuit));
        window.connectSignal(NLBindMouseSlot(NLApplication, onMouseMove));
    

    Fehlerstelle im libsigc++ Code:

    static T_return call_it(slot_rep* rep, typename type_trait<T_arg1>::take a_1,typename type_trait<T_arg2>::take a_2)
        {
          typedef typed_slot_rep<T_functor> typed_slot;
          typed_slot *typed_rep = static_cast<typed_slot*>(rep);
          return (typed_rep->functor_).SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take>
                   (a_1,a_2);
        }
    

    Hoffe jemand kann mir helfen.
    rya.


Anmelden zum Antworten