IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

wxWidgets Discussion :

pb utilisation wxwidget


Sujet :

wxWidgets

  1. #1
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut pb utilisation wxwidget
    bonjour

    je pense que ce problème revient souvent, en tout cas c'est ce que j'ai constaté en cherchant à résoudre mon problème...
    j'ai esayé plusieurs procédure mais aucune ne fonctionne...

    je veux utiliser wxwidget 2.8.4 avec MinGW sous Windows XP Pro
    j'ai installé Mingw et mysys avec la version 3.2.3 de gcc

    Mingw, Msys et wxwidget sont installés sur c:
    la bib wxwidget est compilée.
    j'ai défini une variable d'environnement

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    WXWIN=C:\wxWidgets-2.8.4
    Dans mon PATH j'ai mis

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    C:\MinGW\bin;C:\MinGW\Msys\1.0\bin;C:\wxWidgets-2.8.4\include;
    et donc voici mes 2 fichiers qui me permettent d'afficher une simple fenetre avec wxwidget:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
    /********/
    /*basic.h*/
    /*******/
     
    #ifndef BASIC_H
    #define BASIC_H
     
    class BasicApplication: public wxApp
    {
    	public:
    		virtual bool OnInit();
    };
     
    class BasicFrame: public wxFrame
    {
    	public:
    		BasicFrame(const wxChar *titile, int xpos, int ypos, int width, int height);
    		~BasicFrame();
    };
     
    #endif

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
     
    /**********/
    /*basic.cpp*/
    /*********/
     
    #include "basic.h"
    #include <wx/wx.h>
     
    IMPLEMENT_APP(BasicApplication)
     
    bool Basicpplication::OnInit()
    {
    	BasicFrame *frame = new BasicFrame("Basic", 50, 50, 450, 300);
    	frame->Show(TRUE);
    	SetTopWindow(frame);
    	return TRUE;
    }
     
    BasicFrame::BasicFrame(const wxChar *title, int xpos, int ypos intwidth, int height): 
    					wxFrame((wxFrame *)NULL, -1, title, wxPoint(xpos, ypos), wxSize(widht, heigt))
    {
    }
     
    BasicFrame::~BasicFrame()
    {
    }
    et j'ai les erreurs suivantes:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
     
    gcc -o basic basic.cpp basic.h
    In file included from basic.cpp:5:
    basic.h:9: parse error before `{' token
    basic.h:15: parse error before `{' token
    basic.h:18: destructors must be member functions
    basic.h:19: parse error before `}' token
    basic.cpp:6:19: wx/wx.h: No such file or directory
    basic.cpp:10: ISO C++ forbids declaration of `IMPLEMENT_APP' with no type
    basic.cpp: In function `int IMPLEMENT_APP(BasicApplication)':
    basic.cpp:10: `<anonymous>' has incomplete type
    basic.h:8: forward declaration of `class BasicApplication'
    basic.cpp:10: parse error before `bool'
    basic.cpp:10: syntax error before `::' token
    basic.cpp:13: syntax error before `->' token
    basic.cpp:14: `frame' undeclared (first use this function)
    basic.cpp:14: (Each undeclared identifier is reported only once for each 
       function it appears in.)
    basic.cpp:14: ISO C++ forbids declaration of `SetTopWindow' with no type
    basic.cpp:15: parse error before `return'
    basic.cpp:18: parse error before `*' token
    basic.cpp:18: invalid use of undefined type `class BasicFrame'
    basic.h:14: forward declaration of `class BasicFrame'
    basic.cpp: In constructor `BasicFrame::BasicFrame(...)':
    basic.cpp:19: `wxFrame' undeclared (first use this function)
    basic.cpp:19: parse error before `)' token
    basic.cpp:19: `xpos' undeclared (first use this function)
    basic.cpp:19: `ypos' undeclared (first use this function)
    basic.cpp:19: class `BasicFrame' does not have any field named `wxPoint'
    basic.cpp:19: `widht' undeclared (first use this function)
    basic.cpp:19: `heigt' undeclared (first use this function)
    basic.cpp:19: class `BasicFrame' does not have any field named `wxSize'
    basic.cpp:19: parse error before `)' token
    basic.cpp:24: invalid use of undefined type `class BasicFrame'
    basic.h:14: forward declaration of `class BasicFrame'
    g++.exe: compilation of header file requested
    make: *** [basic] Error 1
    je pense que toutes ces erreurs viennent du fait que gcc ne trouve pas le fichier wx/wx.h
    non ?
    par contre je ne comprend pas pourquoi il ne le trouve pas, le PATH me parait correct...

    est-ce que quelqu'un à une idée?
    merci d'avance

  2. #2
    Membre éclairé

    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    717
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 717
    Points : 858
    Points
    858
    Par défaut
    gcc -o basic basic.cpp basic.h
    Attention, gcc c'est pour compiler du C. Pour du C++ c'est g++.

    Aussi, seul les .cpp doivent être compilés, pas les .h.

  3. #3
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    merci, mais ca résoud pas mon problème de PATH ou de je sais pas quoi...

  4. #4
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    lorsque je fait

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    g++ -o basic basic.cpp -I"C:/wxWidgets-2.8.4/include"
    j'ai les erreurs suivantes:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
     
    In file included from C:/wxWidgets-2.8.4/include/wx/defs.h:21,
                     from C:/wxWidgets-2.8.4/include/wx/wx.h:15,
                     from basic.cpp:5:
    C:/wxWidgets-2.8.4/include/wx/platform.h:196:22: wx/setup.h: No such file or directory
    In file included from C:/wxWidgets-2.8.4/include/wx/platform.h:279,
                     from C:/wxWidgets-2.8.4/include/wx/defs.h:21,
                     from C:/wxWidgets-2.8.4/include/wx/wx.h:15,
                     from basic.cpp:5:
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:98:9: #error "wxUSE_DYNLIB_CLASS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:106:9: #error "wxUSE_EXCEPTIONS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:114:9: #error "wxUSE_FILESYSTEM must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:122:9: #error "wxUSE_FS_ARCHIVE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:135:9: #error "wxUSE_DYNAMIC_LOADER must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:143:9: #error "wxUSE_LOG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:151:9: #error "wxUSE_LONGLONG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:159:9: #error "wxUSE_MIMETYPE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:175:9: #error "wxUSE_PRINTF_POS_PARAMS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:183:9: #error "wxUSE_PROTOCOL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:225:9: #error "wxUSE_REGEX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:233:9: #error "wxUSE_STDPATHS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:241:9: #error "wxUSE_XML must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:249:9: #error "wxUSE_SOCKETS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:257:9: #error "wxUSE_STREAMS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:265:9: #error "wxUSE_STOPWATCH must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:273:9: #error "wxUSE_TEXTBUFFER must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:281:9: #error "wxUSE_TEXTFILE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:297:9: #error "wxUSE_URL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:305:9: #error "wxUSE_VARIANT must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:325:9: #error "wxUSE_ABOUTDLG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:333:9: #error "wxUSE_ACCEL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:341:9: #error "wxUSE_ANIMATIONCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:349:9: #error "wxUSE_BITMAPCOMBOBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:357:9: #error "wxUSE_BMPBUTTON must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:365:9: #error "wxUSE_BUTTON must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:373:9: #error "wxUSE_CALENDARCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:381:9: #error "wxUSE_CARET must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:389:9: #error "wxUSE_CHECKBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:405:9: #error "wxUSE_CHOICE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:413:9: #error "wxUSE_CHOICEBOOK must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:421:9: #error "wxUSE_CHOICEDLG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:429:9: #error "wxUSE_CLIPBOARD must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:437:9: #error "wxUSE_COLLPANE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:445:9: #error "wxUSE_COLOURDLG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:453:9: #error "wxUSE_COLOURPICKERCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:461:9: #error "wxUSE_COMBOBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:469:9: #error "wxUSE_COMBOCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:477:9: #error "wxUSE_DATAOBJ must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:485:9: #error "wxUSE_DATAVIEWCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:493:9: #error "wxUSE_DATEPICKCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:501:9: #error "wxUSE_DIRPICKERCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:509:9: #error "wxUSE_DISPLAY must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:517:9: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:525:9: #error "wxUSE_FILEDLG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:533:9: #error "wxUSE_FILEPICKERCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:541:9: #error "wxUSE_FONTDLG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:549:9: #error "wxUSE_FONTMAP must be defined."
     
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:557:9: #error "wxUSE_FONTPICKERCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:565:9: #error "wxUSE_GAUGE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:573:9: #error "wxUSE_GRAPHICS_CONTEXT must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:582:9: #error "wxUSE_GRID must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:590:9: #error "wxUSE_HELP must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:598:9: #error "wxUSE_HYPERLINKCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:606:9: #error "wxUSE_HTML must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:627:9: #error "wxUSE_ICO_CUR must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:635:9: #error "wxUSE_IFF must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:643:9: #error "wxUSE_IMAGLIST must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:651:9: #error "wxUSE_JOYSTICK must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:659:9: #error "wxUSE_LISTBOOK must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:667:9: #error "wxUSE_LISTBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:675:9: #error "wxUSE_LISTCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:683:9: #error "wxUSE_LOGGUI must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:691:9: #error "wxUSE_LOGWINDOW must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:699:9: #error "wxUSE_LOG_DIALOG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:707:9: #error "wxUSE_MDI must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:715:9: #error "wxUSE_MDI_ARCHITECTURE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:723:9: #error "wxUSE_MENUS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:731:9: #error "wxUSE_MSGDLG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:739:9: #error "wxUSE_NOTEBOOK must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:747:9: #error "wxUSE_ODCOMBOBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:755:9: #error "wxUSE_PALETTE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:763:9: #error "wxUSE_POPUPWIN must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:771:9: #error "wxUSE_PRINTING_ARCHITECTURE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:779:9: #error "wxUSE_RADIOBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:787:9: #error "wxUSE_RADIOBTN must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:795:9: #error "wxUSE_SASH must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:803:9: #error "wxUSE_SCROLLBAR must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:811:9: #error "wxUSE_SLIDER must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:819:9: #error "wxUSE_SOUND must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:827:9: #error "wxUSE_SPINBTN must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:835:9: #error "wxUSE_SPINCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:843:9: #error "wxUSE_SPLASH must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:851:9: #error "wxUSE_SPLITTER must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:859:9: #error "wxUSE_STATBMP must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:867:9: #error "wxUSE_STATBOX must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:875:9: #error "wxUSE_STATLINE must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:883:9: #error "wxUSE_STATTEXT must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:891:9: #error "wxUSE_STATUSBAR must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:899:9: #error "wxUSE_TAB_DIALOG must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:907:9: #error "wxUSE_TEXTCTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:915:9: #error "wxUSE_TIPWINDOW must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:923:9: #error "wxUSE_TOOLBAR must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:931:9: #error "wxUSE_TOOLTIPS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:939:9: #error "wxUSE_TREECTRL must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:947:9: #error "wxUSE_VALIDATORS must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:955:9: #error "wxUSE_WXHTML_HELP must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:963:9: #error "wxUSE_XRC must be defined."
    C:/wxWidgets-2.8.4/include/wx/chkconf.h:1760:9: #error "wxMessageBox is always needed"
    In file included from C:/wxWidgets-2.8.4/include/wx/region.h:222,
                     from C:/wxWidgets-2.8.4/include/wx/window.h:26,
                     from C:/wxWidgets-2.8.4/include/wx/wx.h:36,
                     from basic.cpp:5:
    C:/wxWidgets-2.8.4/include/wx/msw/region.h: In constructor 
       `wxRegion::wxRegion(const wxBitmap&, const wxColour&, int)':
    C:/wxWidgets-2.8.4/include/wx/msw/region.h:31: no matching function for call to 
       `wxRegion::Union(const wxBitmap&, const wxColour&, int&)'
    C:/wxWidgets-2.8.4/include/wx/region.h:128: candidates are: bool 
       wxRegionBase::Union(int, int, int, int)
    C:/wxWidgets-2.8.4/include/wx/region.h:130:                 bool 
       wxRegionBase::Union(const wxRect&)
    C:/wxWidgets-2.8.4/include/wx/region.h:132:                 bool 
       wxRegionBase::Union(const wxRegion&)
    basic.cpp: At global scope:
    basic.cpp:12: syntax error before `::' token
    basic.cpp:15: syntax error before `->' token
    basic.cpp:16: `frame' was not declared in this scope
    basic.cpp:16: ISO C++ forbids declaration of `SetTopWindow' with no type
    basic.cpp:17: parse error before `return'
    basic.cpp:20: parse error before `,' token
    make: *** [basic] Error 1

    il y a donc bien un prob de PATH ou de recherche de fichier d'en-tete...
    par contre comment le résoudre et que signifient les nouvelles erreurs?

  5. #5
    Membre éclairé

    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    717
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 717
    Points : 858
    Points
    858
    Par défaut
    Le fichier setup.h ne se trouve pas dans include/ mais quelque part dans lib/, il faut rajouter ce path.

  6. #6
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    pas de fichier setup.h dans le répoertoire 'lib' ou dans les sous répertoires...
    par contre j'en ai un dans WXWIN\include\wx\msw, j'ai mis ce répertoire dans mon PATH pour tester mais quand je compile il me sort une tripoté d'erreur 'undefined reference' pour un tas de fonctions...

  7. #7
    Membre éclairé

    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    717
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 717
    Points : 858
    Points
    858
    Par défaut
    C'est bien tu progresses !

    Les erreurs 'undefined reference' c'est des erreurs de linkage. Il faut lui indiquer les fichiers .lib de wxWidgets à utiliser, et dans quels chemins les trouver (options -l et -L il me semble).

  8. #8
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    ca me rassure Sylvain Togni...
    enfin presque, parce que le seul fichier *.lib que je trouve c'est odbc32.lib ...

    peut on les créer à partir d'autres fichiers ? et si oui, comment ?

  9. #9
    Membre éclairé

    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    717
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 717
    Points : 858
    Points
    858
    Par défaut
    en fait sous MinGW ça doit être plutôt des fichiers .a

  10. #10
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    après avoir laissé ce sujet reposé quelques jours, me revoila...

    j'ai recherché tous les fichiers *.a sur mon disque dur et je l'ai ai inclus dans la compilation:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    g++ -o basic basic.cpp -I"C:/wxWidgets-2.8.4/include/" -I"C:\wxWidgets-2.8.4\build-debug\lib"  -I"C:/wxWidgets-2.8.4/include/wx/msw/" -I"C:\MinGW\lib"
    mais maintenant j'ai l'erreur suivante:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
     
    In file included from c:/MinGW/include/windows.h:75,
                     from C:/wxWidgets-2.8.4/include/wx/msw/wrapwin.h:51,
                     from C:/wxWidgets-2.8.4/include/wx/msw/app.h:92,
                     from C:/wxWidgets-2.8.4/include/wx/app.h:562,
                     from C:/wxWidgets-2.8.4/include/wx/wx.h:26,
                     from basic.cpp:5:
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:100: `wxDDEConnectionList' declared as 
       an `inline' field
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:100: parse error before `&' token
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:105: semicolon missing after 
       declaration of `wxDDEServer'
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h: In member function `wxString& 
       wxDDEServer::GetServiceName() const':
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:99: `m_serviceName' undeclared (first 
       use this function)
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:99: (Each undeclared identifier is 
       reported only once for each function it appears in.)
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h: At global scope:
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:105: parse error before `:' token
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:107: `wxString m_serviceName' used 
       prior to declaration
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:108: 'wxDDEConnectionList' is used as a 
       type, but is not defined as a type.
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:109: parse error before `}' token
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:130: `wxDDEConnectionList' declared as 
       an `inline' field
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:130: parse error before `&' token
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:135: semicolon missing after 
       declaration of `wxDDEClient'
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:137: 'wxDDEConnectionList' is used as a 
       type, but is not defined as a type.
    C:/wxWidgets-2.8.4/include/wx/msw/dde.h:138: parse error before `}' token
    make: *** [basic] Error 1
    !!!

  11. #11
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    allé, on continu !!!!!

    j'ai rajouté

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    #include <wx/msw/wx.rc>
    au fichier basic .cpp

    et je n'ai plus que l'erreur suivante:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    ...wxWidgets/include/wx/msw/wx.rc:30: parse error before `BEGIN'
    qu'est ce que c'est que ce binssss !!!!!!!??????????????

  12. #12
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    25
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2002
    Messages : 25
    Points : 34
    Points
    34
    Par défaut
    Salut,

    si tu as compiler wxwidgets sous msys (ce qui semble le cas),avec :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    ./configure
    make
    make install
    tu peux utiliser 'wx-config --cxxflags --libs' :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    g++ -c basic.cpp -o basic.o `wx-config --cxxflags`
    g++ basic.o -o basic.exe `wx-config --libs`
    De plus,
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    #include <wx/wx.h>
    et
    #include <wx/msw/wx.rc>
    doivent être dans basic.h et non pas dans basic.cpp
    avant la déclaration de la classe
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    class BasicApplication: public wxApp
    J'espère que cela pourra corrigé tes différents problèmes.
    Just Modeste.
    --

  13. #13
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    bennnnnnnnnnnnnnnnccccccoooooooooooooooooooooooooooooooooooooooooooooooooo


    merci Just Modeste !!
    ca fonctionne !!!

    par contre peux-tu m'expliquer le role de
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    `wx-config --cxxflags`
    et
     `wx-config --libs`

  14. #14
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Celle ci permet de récupérer tous les répertoires d'inclusions ainsi que les paramètres du préprocesseur pour que ton programme puisse compiler avec wxWidgets.

    Ici tu récupères les dossiers lib ainsi que les bibliothèques nécéssaire à l'édition des liens.

  15. #15
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    ok merci beaucoup

  16. #16
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    donc ma petite appli "basic" focntionne, maintenant je passe à un peu plus dur (peu etre pas pour tout le monde, mais pour moi oui...)
    je met ce problème à la suite du précédent, mais s'il est préférable de créer un nouveau post, il n'y a pas de prob

    j'ai donc 2 fichiers *.cpp, 2 *.h et un makefile

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
     
    /******************
    myapp.h
    *******************/
    #ifndef _MYAPP_H_
    #define _MYAPP_H_
     
    class wxMyApp: public wxApp
    {
    	public: 
    		wxMyApp();
    		virtual bool OnInit();
    };
     
    DECLARE_APP(wxMyApp)
     
    #endif //_MYAPP_H_
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
     
    /******************
    myapp.cpp
    ******************/
     
    #include <wx/wx.h>
     
    #include "myapp.h"
    #include "myframe.h"
     
     
    IMPLEMENT_APP(wxMyApp)
     
    wxMyApp::wxMyApp(): wxApp()
    {
    }
     
    bool wxMyApp::OnInit()
    {
    	wxApp::OnInit();
    	wxMyFrame *mainWindow = new wxMyFrame(NULL);
    	mainWindow->SetSize(wxSize(640,480));
    	mainWindow->Show(true);
    	return true;
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
     
    /******************
    myframe.h
    *******************/
     
    #ifndef _MYFRAME_H_
    #define _MYFRAME_H_
     
    class wxMyFrame: public wxFrame
    {
    	public:
     
    		wxMyFrame(wxWindow *parent, 
    				wxWindowID = -1, 
    				const wxString &caption = _("myApp"),
    				const wxPoint &pos = wxDefaultPosition,
    				const wxSize &size = wxDefaultSize,
    				long style = wxDEFAULT_FRAME_STYLE);
     
    		~wxMyFrame();
     
    		bool Create(wxWindow *parent, 
    				wxWindowID = -1, 
    				const wxString &caption = _("myApp"),
    				const wxPoint &pos = wxDefaultPosition,
    				const wxSize &size = wxDefaultSize,
    				long style = wxDEFAULT_FRAME_STYLE);
    };
     
    #endif //_MYFRAME_H_
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
    /******************
    myframe.cpp
    *******************/
     
    #include "myframe.h"
     
    wxMyFrame::wxMyFrame(wxWindow *parent, wxWindowID id, const wxString &caption, const wxPoint pos, const wxSize &size, long style)
    {
    	Create(parent, id, caption, pos, size, tyle);
    }
     
    wxMyFrame::~wxMyFrame()
    {
    }
     
    bool wxMyFrame::Create(wxWindow *parent, wxWindowID id, const wxString &caption, const wxPoint pos, const wxSize &size, long style)
    {
    	wxFrame::Create(parent, id, caption, pos, size, style);
    	return true;
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    #################################
    # makefile
    #################################
     
     
    app: myapp.o myframe.o
    	g++ -o app myapp.o myframe.o `wx-config --libs`
     
    myapp.o: myapp.cpp myapp.h
    	g++ -c myapp.cpp -o myapp.o `wx-config --cxxflags`	
     
    myframe.o: myframe.cpp myframe.h
    	g++ -c myframe.cpp -o myframe.o `wx-config --cxxflags`
    et voici mes erreurs après un make:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
     
    g++ -c myframe.cpp -o myframe.o `wx-config --cxxflags`  
    In file included from myframe.cpp:7:
    myframe.h:5: parse error before `{' token
    myframe.h:15: destructors must be member functions
    myframe.h:17: `wxWindow' was not declared in this scope
    myframe.h:17: `parent' was not declared in this scope
    myframe.h:18: parse error before `=' token
    myframe.cpp:9: `wxWindow' was not declared in this scope
    myframe.cpp:9: `parent' was not declared in this scope
    myframe.cpp:9: parse error before `,' token
    myframe.cpp:10: invalid use of undefined type `class wxMyFrame'
    myframe.h:4: forward declaration of `class wxMyFrame'
    myframe.cpp: In constructor `wxMyFrame::wxMyFrame(...)':
    myframe.cpp:11: `parent' undeclared (first use this function)
    myframe.cpp:11: (Each undeclared identifier is reported only once for each 
       function it appears in.)
    myframe.cpp:11: `id' undeclared (first use this function)
    myframe.cpp:11: `caption' undeclared (first use this function)
    myframe.cpp:11: `pos' undeclared (first use this function)
    myframe.cpp:11: `size' undeclared (first use this function)
    myframe.cpp:11: `tyle' undeclared (first use this function)
    myframe.cpp: At global scope:
    myframe.cpp:15: invalid use of undefined type `class wxMyFrame'
    myframe.h:4: forward declaration of `class wxMyFrame'
    myframe.cpp:18: `wxWindow' was not declared in this scope
    myframe.cpp:18: parse error before `,' token
    myframe.cpp:19: invalid use of undefined type `class wxMyFrame'
    myframe.h:4: forward declaration of `class wxMyFrame'
    myframe.cpp: In member function `bool wxMyFrame::Create(...)':
    myframe.cpp:20: `wxFrame' undeclared (first use this function)
    myframe.cpp:20: parse error before `::' token
    make: *** [myframe.o] Error 1
    quelqu'un sait d'ou peuvent venir mes erreurs ???
    après cela, j'espère pouvoir me lancer un peu plus seul...

  17. #17
    Membre éclairé

    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    717
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 717
    Points : 858
    Points
    858
    Par défaut
    Tu inclus wx.h que dans myapp.cpp, pas dans myframe.cpp.

  18. #18
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    en mettant un

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    #include <wx/wx.h>
    dans myapp.cpp et dans myframe.cpp

    j'ai les erreurs suivantes:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     
    g++ -o myapp.o -c myapp.cpp `wx-config --cxxflags`      
    g++ -c myframe.cpp -o myframe.o `wx-config --cxxflags`  
    myframe.cpp:14: prototype for `wxMyFrame::wxMyFrame(wxWindow*, int, const 
       wxString&, wxPoint, const wxSize&, long int)' does not match any in class `
       wxMyFrame'
    myframe.h:9: candidates are: wxMyFrame::wxMyFrame(const wxMyFrame&)
    myframe.h:12:                 wxMyFrame::wxMyFrame(wxWindow*, int = -1, const 
       wxString& = wxGetTranslation(const wxChar*, const wxChar* = 0)("myApp", 0), 
       const wxPoint& = wxDefaultPosition, const wxSize& = wxDefaultSize, long int 
       = 541072960)
    myframe.cpp:28: prototype for `bool wxMyFrame::Create(wxWindow*, int, const 
       wxString&, wxPoint, const wxSize&, long int)' does not match any in class `
       wxMyFrame'
    myframe.h:16: candidate is: bool wxMyFrame::Create(wxWindow*, int = -1, const 
       wxString& = wxGetTranslation(const wxChar*, const wxChar* = 0)("myApp", 0), 
       const wxPoint& = wxDefaultPosition, const wxSize& = wxDefaultSize, long int 
       = 541072960)
    make: *** [myframe.o] Error 1
    je ne comprend pas d'ou viennent les erreurs...

  19. #19
    Membre éclairé

    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    717
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 717
    Points : 858
    Points
    858
    Par défaut
    Les messages sont assez clairs : il y a une (petite) différence dans la signature de ces deux fonctions entre le .h et le .cpp (il manque un &).

  20. #20
    Membre du Club
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Points : 52
    Points
    52
    Par défaut
    effectivement...
    en tous cas merci !!!
    j'espère que je vais pouvoir m'y mettre sérieusement maintenant...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Licence d'utilisation wxwidget
    Par mathieu57 dans le forum wxWidgets
    Réponses: 8
    Dernier message: 21/06/2007, 17h19
  2. [windows] compiler un programme utilisant wxWidgets
    Par and1hotsauce dans le forum wxWidgets
    Réponses: 7
    Dernier message: 24/01/2007, 19h01
  3. Utiliser wxWidgets
    Par vdumont dans le forum wxWidgets
    Réponses: 5
    Dernier message: 22/11/2006, 10h50
  4. [VC++ Express] est il possible d'utiliser wxWidgets
    Par Ndugu dans le forum VC++ .NET
    Réponses: 1
    Dernier message: 20/09/2006, 11h22
  5. Utiliser wxWidgets sous devcpp ?
    Par aziz jim dans le forum wxWidgets
    Réponses: 3
    Dernier message: 28/06/2006, 14h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo