error: expected constructor, destructor, or type conversion before ‘;’ token CEGUI

763 Views Asked by At

I am new in here, at least posting because I have read several posts that have help me. Now I would like to see if someone could help with this code:

#ifndef CPFSTATIC_H_
#define CPFSTATIC_H_

#include <CEGUI/CEGUI.h>
#include <CEGUI/CEGUIWindowRendererModule.h>
#include "CPFStaticProperties.h"

namespace CEGUI{
    /*!
     * \brief
     *      Based in FalagardStatic class.
     *
     *      This class requires LookNFeel to be assigned. The LookNFeel should     provide the following:
     *      States:
     *          - Enabled                     - basic rendering for enabled state.
     *          - Disabled                    - basic rendering for disabled state.
     *          - EnabledFrame                - frame rendering for enabled state
     *          - DisabledFrame               - frame rendering for disabled state.
     *          - WithFrameEnabledBackground  - backdrop rendering for enabled state with frame enabled.
     *          - WithFrameDisabledBackground - backdrop rendering for disabled state with frame enabled.
     *          - NoFrameEnabledBackground    - backdrop rendering for enabled state with frame disabled.
     *          - NoFrameDisabledBackground   - backdrop rendering for disabled state with frame disabled.
     */
class CPFStatic : public WindowRenderer
{
public:
    static const utf8   TypeName[];

    CPFStatic(const String &type);
    virtual ~CPFStatic();

    bool    isFrameEnabled() const { return d_frameEnabled; }
    bool    isBackgroundEnabled() const { return d_backgroundEnabled; }
    void    setFrameEnabled(bool setting);
    void    setBackgroundEnabled(bool setting);

    virtual void render();

protected:
    // static properties
    static CPFStaticProperties::FrameEnabled        d_frameEnabledProperty;
    static CPFStaticProperties::BackgroundEnabled   d_backgroundEnabledProperty;

    // implementation data
    bool    d_frameEnabled;
    bool    d_backgroundEnabled;
};
//CEGUI_DEFINE_WR_FACTORY(CPFStatic)
CEGUI::WindowRendererManager::addFactory<TplWindowRendererFactory<CPFStatic> >();
}

#endif /* CPFSTATIC_H_ */

I'm working on debian testing, the problem I'm having is that when compiling I get

CPFStatic.h:69:82: error: expected constructor, destructor, or type conversion before ‘;’ token

I just don't get it. For what I see it should be working. I would appreciate any help.

1

There are 1 best solutions below

0
On

This line of code is attempting to call a static member function of the WindowRendererManager.

CEGUI::WindowRendererManager::addFactory<TplWindowRendererFactory<CPFStatic> >();

However, the current location of this function call is not a valid spot to call from. You should add the function call into a method that runs during program initialization (so the factory is available for the duration of execution). This could be at the beginning of main() or some other method in your application.