Visualizzazione dei risultati da 1 a 10 su 10

Discussione: c++ plugin sintassi

  1. #1

    c++ plugin errore in fase di compilazione

    salve a tutti ...

    plugin x decoder satellitare con sistema linu
    da poco che mi sono avvicinato al c++
    non me lo compila e non so quale sia il problema

    Source File
    codice:
    #include <plugin.h>
    #include <stdio.h>
    #include <lib/gui/ewindow.h>
    #include <lib/gui/ebutton.h>
    #include <lib/gui/eskin.h>
    #include <lib/gui/elabel.h>
    #include <lib/gui/eprogress.h>
    #include <lib/gdi/font.h>
    #include <lib/gui/guiactions.h>
    #include <lib/system/info.h>
    #include <lib/gui/emessage.h>
    
    #define NUM_SCRIPTS 10
    
    class eScriptWindow: public eWindow
    {
        eButton *bt_scripts[10];
        eLabel *label;
        void runScript(int i);
        void initButtons();
    public:
        eScriptWindow();
    };
    
    class eShowFile: public eWindow
    {
        eLabel *label;
        eWidget *visible;
        eProgress *scrollbar;
        int pageHeight;
        int total;
        int eventHandler(const eWidgetEvent &event);
        void updateScrollbar();
    public:
        eShowFile();
    };
    
    extern "C" int plugin_exec( PluginParam *par )
    {
        eScriptWindow dlg;
        dlg.show();
        int result=dlg.exec();
        dlg.hide();
        return result;
    }
    
    eScriptWindow::eScriptWindow(): eWindow(1)
    {
        cmove(ePoint(100, 100));
        cresize(eSize(520, 376));
        setText((_("Plugin")));
        initButtons();
    }
    
    void eScriptWindow::initButtons()
    {
        bool empty=true;
        int j = 1;
        eString filename;
        char    text[80];
        char    ch;
        FILE *  tf;
        int    count;
        
        for(int i=1; i<NUM_SCRIPTS; i++)
        {
            if (eSystemInfo::getInstance()->getHwType() == eSystemInfo::DM7020)
                filename.sprintf("/usr/bin/script%.02d.sh", i);
            else 
                filename.sprintf("/var/bin/script%.02d.sh", i);
            if (access(filename.c_str(), 0) == 0)
            {
                bt_scripts[j-1]=new eButton(this);
                bt_scripts[j-1]->move(ePoint(10, 10+((j-1)*32)));
                bt_scripts[j-1]->resize(eSize(clientrect.width()-20, 30));
                bt_scripts[j-1]->setShortcut(eString().sprintf("%d",i));
                bt_scripts[j-1]->setShortcutPixmap(eString().sprintf("%d",j));
                bt_scripts[j-1]->loadDeco();
                tf=fopen(filename.c_str(),"r");
                if (tf==NULL){
                        bt_scripts[j-1]->setText(eString().sprintf("Script #%d (%s)", j, filename.c_str()));
                }
                else{
                    count=0;
                    fscanf(tf,"%c",&ch);            
                    text[0]=0;
                        while ((ch!=10)&&(ch!=13)&&(count<50)){
                    fscanf(tf,"%c",&ch);
                    if ((ch!=10)&&(ch!=13)) text[count++]=ch;
                    }
                        bt_scripts[j-1]->setText(eString().sprintf("%s", text));
                    fclose(tf);
                }
                CONNECT_1_0(bt_scripts[j-1]->selected, eScriptWindow::runScript, i);
                if (empty)
                    empty = false;
                ++j;
            }
        }
    
        if (empty)
        {    
            label = new eLabel(this);
            label->setFlags(RS_WRAP);
               label->setText((_("No Found!\n\nYou can place script01.sh - script09.sh in /var/bin (/usr/bin  Dreambox 7020)")));
               label->move(ePoint(10, 10));
               label->resize(eSize(clientrect.width()-20, 100));
               label->loadDeco();
        }    
        else 
            setFocus(bt_scripts[0]);
    }
    
    void eScriptWindow::runScript(int i)
    {
        if (eSystemInfo::getInstance()->getHwType() == eSystemInfo::DM7020)
            system(eString().sprintf("/usr/bin/script%.02d.sh > /var/tmp/script.out 2>&1", i).c_str());
        else
            system(eString().sprintf("/var/bin/script%.02d.sh > /var/tmp/script.out 2>&1", i).c_str());
        hide();
        eShowFile execute;
        execute.show();
        execute.exec();
        execute.hide();
        show();
        setFocus(bt_scripts[0]);
    }
    
    
    eShowFile::eShowFile():
    eWindow(1)
    {
       cmove(ePoint(70, 85));
       cresize(eSize(595, 450));
    
       setText((_("Script Output")));
    
       scrollbar = new eProgress(this);
       scrollbar->setName("scrollbar");
       scrollbar->setStart(0);
       scrollbar->setPerc(100);
       scrollbar->move(ePoint(width() - 30, 5));
       scrollbar->resize(eSize(20, height() - 100));
       scrollbar->setProperty("direction", "1");
    
       visible = new eWidget(this);
       visible->setName("visible");
       visible->move(ePoint(10, 5));
       visible->resize(eSize(width() - 40, height() - 100));
    
    
       eString strview;
       char buf[256];
    
       FILE *f = fopen("/var/tmp/script.out", "rt");
       if (f)
       {
          int len = 0;
          while (fgets(buf, 256, f))
          {
             len += strlen(buf);
             if (len <= 65536)
                strview += eString().sprintf("%s", buf);
          }
          fclose(f);
       }
    
       ::unlink("/var/tmp/script.out");
    
    
       label = new eLabel(visible);
       label->setFlags(RS_WRAP);
       label->setFont(eSkin::getActive()->queryFont("eStatusBar"));
       float lineheight = fontRenderClass::getInstance()->getLineHeight(label->getFont());
       int lines = (int) (visible->getSize().height() / lineheight);
       pageHeight = (int) (lines * lineheight);
       visible->resize(eSize(visible->getSize().width(), pageHeight + (int) (lineheight / 6)));
       label->resize(eSize(visible->getSize().width(), pageHeight * 16));
    
       label->hide();
       label->move(ePoint(0, 0));
       label->setText(strview);
       updateScrollbar();
       label->show();
    }
    
    int eShowFile::eventHandler(const eWidgetEvent & event)
    {
       switch (event.type)
       {
       case eWidgetEvent::evtAction:
          if (total && event.action == &i_cursorActions->up)
          {
             ePoint curPos = label->getPosition();
             if (curPos.y() < 0)
             {
                label->move(ePoint(curPos.x(), curPos.y() + pageHeight));
                updateScrollbar();
             }
          }
          else if (total && event.action == &i_cursorActions->down)
          {
             ePoint curPos = label->getPosition();
             if ((total - pageHeight) >= abs(curPos.y() - pageHeight))
             {
                label->move(ePoint(curPos.x(), curPos.y() - pageHeight));
                updateScrollbar();
             }
          }
          else if (event.action == &i_cursorActions->cancel)
             close(0);
          else
             break;
          return 1;
       default:
          break;
       }
       return eWindow::eventHandler(event);
    }
    
    void eShowFile::updateScrollbar()
    {
       total = pageHeight;
       int pages = 1;
       while (total < label->getExtend().height())
       {
          total += pageHeight;
          pages++;
       }
    
       int start = -label->getPosition().y() * 100 / total;
       int vis = pageHeight * 100 / total;
       scrollbar->setParams(start, vis);
       scrollbar->show();
       if (pages == 1)
          total = 0;
    }
    perchè in fase di compilazione mi da questi errori ?
    codice:
    /home/xxx/7000/root/cdk/lib/gcc/powerpc-tuxbox-linux-gnu/3.4.4/../../../../powerpc-tuxbox-linux-gnu/include/ft2build.h:55:38: freetype/config/ftheader.h: No such file or directory
    In file included from Plugin.cpp:10:
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:5:10: #include expects "FILENAME" or <FILENAME>
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:6:10: #include expects "FILENAME" or <FILENAME>
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:7:10: #include expects "FILENAME" or <FILENAME>
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:8:10: #include expects "FILENAME" or <FILENAME>
    In file included from Plugin.cpp:10:
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:37: error: `FT_Library' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:38: error: `FTC_Manager' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:39: error: `FTC_Image_Cache' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:40: error: `FTC_SBit_Cache' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:42: error: `FTC_FaceID' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:43: error: `FT_Error' does not name a type
    /hom/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:49: error: `FT_Error' does not name a type
    /home/rockydevil/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:69: error: `FT_ULong' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:82: error: `FT_Face' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:96: error: `FT_Face' has not been declared
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:96: error: `FT_UInt' has not been declared
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:96: error: ISO C++ forbids declaration of `current_face' with no type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:96: error: ISO C++ forbids declaration of `glyphIndex' with no type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h: In constructor `eTextPara::eTextPara(eRect, ePoint)':
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:103: error: class `eTextPara' does not have any field named `current_face'
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:103: error: class `eTextPara' does not have any field named `replacement_face'
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h: At global scope:
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:142: error: `FTC_Image_Desc' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:145: error: `FT_Error' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:146: error: `FT_Face' does not name a type
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:147: error: `FT_Size' does not name a type
    /home/rxxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:151: error: `FTC_FaceID' has not been declared
    /home/xxx/7000/apps/tuxbox/enigma/include/lib/gdi/font.h:151: error: ISO C++ forbids declaration of `faceid' with no type
    make: *** [Plugin] Error 1
    grazie

  2. #2
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,462
    Il primo errore mi sembra chiaro

    "freetype/config/ftheader.h: No such file or directory"
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  3. #3
    Originariamente inviato da oregon
    Il primo errore mi sembra chiaro

    "freetype/config/ftheader.h: No such file or directory"
    ciao intanto grazie x la risposta

    in parole povere?

    saluti

  4. #4
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,462
    Piu' povere di come sono state indicate?

    Manca quel file ... non so come dirlo diversamente ...
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  5. #5
    Originariamente inviato da oregon
    Piu' povere di come sono state indicate?

    Manca quel file ... non so come dirlo diversamente ...
    ciao in effetti hai ragione scusa

    come posso risolvere il problema ?

  6. #6
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,462
    Veramente non so ... non ho quel prodotto installato ... se manca il file, penso sia un problema di installazione ...
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  7. #7
    Originariamente inviato da oregon
    Veramente non so ... non ho quel prodotto installato ... se manca il file, penso sia un problema di installazione ...
    ciao

    credo proprio che sia cosi

    e come sintassi noti qualche problema ?


    scusa ancora e grazie

  8. #8
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,462
    Non noto nulla di particolare ... ma con quell'errore, e' difficile dirlo ...
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  9. #9
    ciao ho controllato ma l'installazione è corretta

    potrebbe essere il Makefile ?

    codice:
    PLUGIN =
    VERSIONE =
    CDK_SRC =
    CDKROOT =
    CDKBIN =
    CXX = $(CDKBIN)/powerpc-tuxbox-linux-gnu-g++
    STRIP = $(CDKBIN)/powerpc-tuxbox-linux-gnu-strip
    
    INCLUDES = -I$(CDK_SRC)/apps/tuxbox/enigma/include -I$(CDK_SRC)/driver/include -I$(CDKROOT)/include -I$(CDKROOT)/include/freetype2 -I$(CDKROOT)/include/sigc++-1.2 -I$(CDKROOT)/lib/sigc++-1.2/include -I$(CDK_SRC)/apps/tuxbox/enigma -I$(CDK_SRC)/apps/misc/libs/libxmltree -I$(CDK_SRC)/apps/tuxbox/plugins/include -I. -I$(CDK_SRC)/apps/tuxbox/enigma/src
    
    #a
    #CFLAGS = -DEMU_PLUGIN $(INCLUDES) -fno-rtti -fno-exceptions -Wall -O2 -mcpu=405 -msoft-float -mmultiple -mstring -meabi -g3 -gdwarf-2 -pipe
    #b
    CFLAGS = -DEMU_PLUGIN $(INCLUDES) -fno-rtti -fno-exceptions -Wall -O2 -mcpu=405 -msoft-float -mmultiple -mstring -g -ggdb3 -pipe
    
    LINK_OPTIONS = -shared -Wall -O2 -mcpu=405 -msoft-float -mmultiple -mstring -g -ggdb3 -pipe
    
    OBJECTS = nome
    
    all: $(PLUGIN)
    
    $(PLUGIN): $(OBJECTS)
    
    $(CXX) $(LINK_OPTIONS) -o $(PLUGIN) $(OBJECTS)
    $(STRIP) -s $(PLUGIN)
    
    %.o: %.cpp
    $(CXX) $(CFLAGS) -c $<
    
    clean:
    rm -rf *.o
    rm -rf *.so

  10. #10
    ciao superato errore freytape

    altri errori

    codice:
    /home/7000/root/cdkroot/include/sigc++-1.2/sigc++/bind.h:111: undefined reference to `vtable for SigC::ObjectSlotNode'
    /tmp/ccoAxFwb.o(.gnu.linkonce.t._ZN4SigC4slotIvi13eScri ptWindowS1_EENS_5Slot1IT_T0_EERT1_MT2_FS3_S4_E+0x5 c):/home/7000/root/cdkroot/include/sigc++-1.2/sigc++/bind.h:167: undefined reference to `SigC::ObjectSlotNode::init(SigC::Object*, void*, void (SigC::Object::*)())'
    /tmp/ccoAxFwb.o(.gnu.linkonce.t._ZN4SigC4slotIvi13eScri ptWindowS1_EENS_5Slot1IT_T0_EERT1_MT2_FS3_S4_E+0x7 0): In function `SigC::Slot1<void, int> SigC::slot<void, int, eScriptWindow, eScriptWindow>(eScriptWindow&, void (eScriptWindow::*)(int))':
    /7000/apps/tuxbox/enigma/include/lib/base/epoint.h:94: undefined reference to `SigC::Node::assign(SigC::NodeBase*)'
    /tmp/ccoAxFwb.o(.gnu.linkonce.t._ZN4SigC4bindIiviEENS_5 Slot0IT0_EERKNS_5Slot1IS2_T1_EET_+0x3c): In function `SigC::Slot0<void> SigC::bind<int, void, int>(SigC::Slot1<void, int> const&, int)':
    /home/7000/root/cdkroot/include/sigc++-1.2/sigc++/bind.h:111: undefined reference to `SigC::AdaptorBindSlotNode::AdaptorBindSlotNode(vo id (*)(void*), SigC::Node const&, void (*)(void*))'
    /tmp/ccoAxFwb.o(.gnu.linkonce.t._ZN4SigC4bindIiviEENS_5 Slot0IT0_EERKNS_5Slot1IS2_T1_EET_+0x54): In function `SigC::Slot0<void> SigC::bind<int, void, int>(SigC::Slot1<void, int> const&, int)':
    /home/7000/root/cdkroot/include/sigc++-1.2/sigc++/slot.h:212: undefined reference to `SigC::Node::assign(SigC::NodeBase*)'
    collect2: ld returned 1 exit status
    make: *** [Plugin] Error 1
    qualche suggerimento ? grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.