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 :

Problème de compilation avec MinGW


Sujet :

wxWidgets

  1. #1
    Rédacteur

    Profil pro
    Étudiant
    Inscrit en
    Juin 2004
    Messages
    113
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2004
    Messages : 113
    Points : 276
    Points
    276
    Par défaut Problème de compilation avec MinGW
    Bonsoir,
    En essayant de compiler un exemple tiré du répertoire "samples" de "wxWidgets-2.8.7" via un make : mingw32-make -f d:\ex\makefile.gcc j'ai le message suivant :
    mingw32-make: *** No rule to make target `controls.cpp', needed by `gcc_mswd\controls_controls.o'. Stop.
    Tout cela étant fait sous winXP. Quelqu'un a une idée sur la source du problème ?

    Merci.

  2. #2
    Membre éprouvé Avatar de Jérémy Lefevre
    Homme Profil pro
    Développeur Java
    Inscrit en
    Juin 2004
    Messages
    898
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Luxembourg

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2004
    Messages : 898
    Points : 969
    Points
    969
    Par défaut
    Salut AjJi,
    Alors pour commencer comment as tu compilé ta librairie?
    dans ton sample controls, tu dois avoir un fichier Makefile il faut utilisé celui la ....
    Rien ne se perd, rien ne se crée, tout se transforme

    ------- -------

  3. #3
    Rédacteur

    Profil pro
    Étudiant
    Inscrit en
    Juin 2004
    Messages
    113
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2004
    Messages : 113
    Points : 276
    Points
    276
    Par défaut
    Je pense que j'ai raté quelque chose là
    oui, j'utilise bien le makefile fournit dans le sample.
    Pouvez-vous m'indiquer la meilleur façon pour compiler wxWidgets, vu que j'ai essayé plusieurs fois sans résultat.
    Merci.

  4. #4
    Membre du Club
    Inscrit en
    Novembre 2006
    Messages
    91
    Détails du profil
    Informations forums :
    Inscription : Novembre 2006
    Messages : 91
    Points : 47
    Points
    47
    Par défaut Problem de compilation Wxwidget sur ubuntu
    Bonjour tt le monde, je suis bloqué sur une compilation de mon projet avec wxwidgets sur ubuntu.
    voici mon programme

    j'ai les fichiers suivants:

    dialogs.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
    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
     
    #ifndef __DIALOGS_H__
     
    #define __DIALOGS_H__
     
     
    #include <wx/wx.h>
     
    #include <wx/accel.h>
     
    #include <wx/gdicmn.h>
     
    #include <wx/colour.h>
     
    #include <wx/spinctrl.h> // pour le spinCtrl
     
    class VersionDialog: public wxDialog {
    public :
    	VersionDialog(wxWindow *parent, wxWindowID id,const wxString &title);
    private :
    	DECLARE_EVENT_TABLE()       
     
    };
     
     
     
     
    class EpaisseurDialog : public wxDialog
     
    {
     
    public :
     
            EpaisseurDialog(wxWindow* parent, wxWindowID id, wxString const & title );
     
     
     
            void Epaisseur();
     
            wxSlider *item2;
     
     
     
    private :
     
            DECLARE_EVENT_TABLE()  
    	void OnScroll(wxScrollEvent& event);
     
     
     
     
     
    };
     
    enum
    {
     
    	ID_TEXT = 10000,
     
     
     
     
     
    };
    dialogs.cpp

    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
     
    #include <stdio.h>
     
    #include <stdlib.h>
     
     
     
    #include "mainframe.h"
     
    #include "dialogs.h"
     
     
     
    BEGIN_EVENT_TABLE(VersionDialog, wxDialog)
    END_EVENT_TABLE ()
     
    VersionDialog::VersionDialog( wxWindow *parent, wxWindowID id,const wxString &title) :
                                  wxDialog( parent, id, title)
     
    {
            //le BoxSizer
    	wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
     
            // Le texte 
    	wxStaticText *item1 = new wxStaticText( this, ID_TEXT, wxT("Version 1.0"),
    	                    wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
     
            // Le bouton OK 		      
    	wxButton *item2 = new wxButton( this, wxID_OK, wxT("OK"),
                              wxDefaultPosition);
     
    	// On ajoute les 2 widgets dans le BoxSizer		  
    	item0->Add(item1, 0, wxALIGN_CENTER | wxALL, 5);
    	item0->Add(item2, 0, wxALIGN_CENTER | wxALL, 5);
     
    	this->SetAutoLayout( TRUE );
    	this->SetSizer( item0 );
    	item0->Fit( this );
    	item0->SetSizeHints( this );
     
    }
    mainframe.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
    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
     
     
    #ifndef __MAINFRAME_H__
     
    #define __MAINFRAME_H__
     
    #include <string.h>
     
    #include <wx/html/helpctrl.h>
     
    #include <wx/wx.h>
     
     
     
     
     
     
     
    class CMainFrame: public wxFrame {
    public:
    	CMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
            void CreateMyToolbar();
     
     
     
    private:
            wxToolBar *m_toolbar;
            wxMenuBar *menu_bar;
     
    	//les rubriques
     
    	wxMenu*fichier_menu ;	
     
    	wxMenu*affichage_menu ;
     
    	wxMenu*option_menu ;
     
    	wxMenu*aide_menu ;
     
     
    	DECLARE_EVENT_TABLE();
     
    // les fonctions liées aux événements
     
      	void OnEpaisseur(wxCommandEvent& event);
    	void OnAPropos(wxCommandEvent& event);
    	void OnQuit(wxCommandEvent& event) ;
     
     
     
    }; //MyFrame
     
     
    // l'énumération des ID
     
    enum 
    {
    	MENU_NEW=0,
    	MENU_OPEN=1,
    	MENU_SAVE=2,
    	MENU_EXIT=3,
    	MENU_EPAI=4,
    	MENU_COLOR=5,
    	MENU_GTRI=6,
    	MENU_VER=7,
    	MENU_TOOLBAR=8,
    	App_is_Draw=9,
    	TOOLBAR_TOOLS=10
    };
     
     
     
    #endif
    mainframe.cpp


    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
     
     
    #include <stdio.h>
     
    #include <stdlib.h>
     
    #include <fstream>
     
    #include "mainframe.h"
     
    #include "dialogs.h"
     
     
     
     
     
    BEGIN_EVENT_TABLE(CMainFrame, wxFrame)
     
    	EVT_MENU(MENU_VER,CMainFrame::OnAPropos)
            EVT_MENU(MENU_EPAI,CMainFrame::OnEpaisseur)
    	EVT_MENU(MENU_EXIT,CMainFrame::OnQuit)
     
    END_EVENT_TABLE()
     
    // Le constructeur
    CMainFrame::CMainFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
    : wxFrame((wxFrame *)NULL, -1, title, pos, size) 
    {
    } 
     
    // Création de la toolbar
    void   CMainFrame::CreateMyToolbar() 
     
     {
    	m_toolbar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL,TOOLBAR_TOOLS);
     
    	wxBitmap toolBarBitmaps[4];
     
    	toolBarBitmaps[0] = wxBitmap(_("new.bmp"),wxBITMAP_TYPE_BMP);
     
    	toolBarBitmaps[1] = wxBitmap(_("open.bmp"),wxBITMAP_TYPE_BMP);
     
    	toolBarBitmaps[2] = wxBitmap(_("save.bmp"),wxBITMAP_TYPE_BMP);
     
    	toolBarBitmaps[3] = wxBitmap(_("draw.bmp"),wxBITMAP_TYPE_BMP);
     
    	m_toolbar->SetToolBitmapSize(wxSize(toolBarBitmaps[0].GetWidth(),toolBarBitmaps[0].GetHeight()));
     
    	m_toolbar->AddTool(MENU_NEW, _("Nouveau"), toolBarBitmaps[0]);
     
    	m_toolbar->AddTool(MENU_OPEN, _("Ouvrir"), toolBarBitmaps[1]);
     
    	m_toolbar->AddTool(MENU_SAVE, _("Sauver"), toolBarBitmaps[2]);
     
    	m_toolbar->AddSeparator();
     
    	m_toolbar->AddCheckTool(App_is_Draw,_("Dessiner"),toolBarBitmaps[3]);
    	SetToolBar(m_toolbar);
    }
     
    //Implémentation des fonctions liées aux événements
     
    void CMainFrame::OnAPropos(wxCommandEvent& event)
     
    {
     
        	//VersionDialog vdlg(this, -1, "Version");
     
        	//vdlg.ShowModal(); 
       wxMessageBox("","A propos !");   
     
    }
     
     
     
    void CMainFrame::OnEpaisseur(wxCommandEvent& event)
     
    {
     
        //EpaisseurDialog Edlg(this, -1, "Epaisseur");
     
        //Edlg.ShowModal();     
     
    }
     
    void CMainFrame::OnQuit(wxCommandEvent& event) 
     {
     
    	Close(TRUE);
     
     }
    main.cpp

    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
     
     
    #include "mainframe.h"
     
    #include "dialogs.h"
     
     
     
    class MyApp: public wxApp 
    {
    	virtual bool OnInit();
    	CMainFrame *m_MainFrame;
    };
     
     
    IMPLEMENT_APP(MyApp)
     
     
    bool MyApp::OnInit() 
    {
           //Création du menu
    	 wxMenuBar *menu_bar = new wxMenuBar;
     
        	wxMenu *fichier_menu = new wxMenu; 
        	wxMenu *affichage_menu = new wxMenu; 
        	wxMenu *option_menu = new wxMenu; 
        	wxMenu *aide_menu = new wxMenu; 
     
    	//Ajouter des rubrique à la barre de menu
    	menu_bar->Append(fichier_menu, wxT("&Fichier"));
    	menu_bar->Append(affichage_menu, wxT("&Affichage"));
            menu_bar->Append(option_menu, wxT("&Option"));
            menu_bar->Append(aide_menu, wxT("A&ide"));
     
    	//Rubrique "Fichier"
    	fichier_menu->Append(MENU_NEW, wxT("Nouveau\tCtrl-N"));
    	fichier_menu->AppendSeparator();
    	fichier_menu->Append(MENU_OPEN, wxT("Ouvrir\tCtrl-O"));
    	fichier_menu->Append(MENU_SAVE, wxT("Sauvegarder\tCtrl-S"));
    	fichier_menu->AppendSeparator();
    	fichier_menu->Append(MENU_EXIT, wxT("Quitter\tCtrl-X"));
     
    	//Rubrique "Option"
    	option_menu->Append(MENU_EPAI, wxT("Epaisseur trait\tCtrl-E"));
    	option_menu->Append(MENU_COLOR, wxT("Couleur\tCtrl-C"));
    	option_menu->Append(MENU_GTRI, wxT("Gestion des triangles\tCtrl-G"));
     
    	//Rubrique "Aide"
    	aide_menu->Append(MENU_VER, wxT("Version\tCtrl-V"));
     
    	//Rubrique "Affichage"
    	affichage_menu->AppendCheckItem(MENU_TOOLBAR,wxT("Barre d'outils\tCtrl-B"));
    	affichage_menu->Check(MENU_TOOLBAR,TRUE);
     
    	//Griser "Gestion des triangles" au démarrage
      	option_menu->Enable(MENU_GTRI,false);
     
     
     
    	m_MainFrame = new CMainFrame( wxString("Gestion des triangles", wxConvUTF8),
    	wxPoint(50,50), wxSize(450,340) );
    	m_MainFrame->SetMenuBar(menu_bar);
    	m_MainFrame->CreateMyToolbar();
    	m_MainFrame->Show(TRUE);
     
    // Les 2 lignes qui m'empechent de compiler
            VersionDialog vdlg(m_MainFrame, -1, "Version");//
     
        	vdlg.ShowModal(); 
     
    	return TRUE;
    }
    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
    18
    19
    20
    21
    22
    23
     
     
    CC = g++
     
    drawtri : main.o mainframe.o dialogs.o
    	$(CC) -o drawtri main.o mainframe.o `wx-config --libs`
     
    main.o : main.cpp 
    	$(CC) `wx-config --cxxflags` -c main.cpp -o main.o
     
    mainframe.o : mainframe.cpp
    	$(CC) `wx-config --cxxflags` -c mainframe.cpp -o mainframe.o
     
     
    dialogs.o : dialogs.cpp
    	$(CC) `wx-config --cxxflags` -c dialogs.cpp -o dialogs.o
     
     
     
     
     
    clean : 
    	rm -f *.o drawtri
    quand je fait make drawtri , il m'affiche

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    mourad@Mourad:~/ihm$ make drawtri
    g++ `wx-config --cxxflags` -c main.cpp -o main.o
    g++ -o drawtri main.o mainframe.o `wx-config --libs`
    main.o: In function `MyApp::OnInit()':
    main.cpp:(.text+0xc1e): undefined reference to `VersionDialog::VersionDialog(wxWindow*, int, wxString const&)'
    main.o: In function `VersionDialog::~VersionDialog()':
    main.cpp:(.text._ZN13VersionDialogD1Ev[VersionDialog::~VersionDialog()]+0x7): undefined reference to `vtable for VersionDialog'
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [drawtri] Erreur 1
    mercie d'avance

  5. #5
    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
    Il manque juste dialogs.o dans le Makefile :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    drawtri : main.o mainframe.o dialogs.o
    	$(CC) -o drawtri main.o mainframe.o dialogs.o `wx-config --libs`

    Par contre, il aurait peut-être mieux fallu ouvrir un nouveau problème, celui-si n'a rien avoir avec le problème initial...
    Just Modeste.
    --

Discussions similaires

  1. [Yes::Engine] problème de compilation avec mingw et <cmath>
    Par jo-leptipois dans le forum Moteurs 3D
    Réponses: 1
    Dernier message: 04/09/2013, 08h06
  2. Problème de compilation avec MinGW
    Par devalender dans le forum C
    Réponses: 4
    Dernier message: 04/04/2013, 13h40
  3. [Débuter] Problème de compilation avec MinGW
    Par matt36295 dans le forum Qt Creator
    Réponses: 1
    Dernier message: 21/01/2013, 02h38
  4. Problème de compilation avec Dev-C++
    Par Rouliann dans le forum Dev-C++
    Réponses: 14
    Dernier message: 14/06/2004, 18h44
  5. Réponses: 1
    Dernier message: 29/10/2003, 12h16

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