Membres inscrits :2359
Membres en ligne : 0
Invités en ligne : 3


|
Conversation (Résolue) : Références indéfinies vers ... |
PatrickMULOT (Membre)
Lieu: JUMELLES 27220
Inscrit le : 28-01-2016
Messages: 22
Snippets: 0
Tutoriels: 0
Hors ligne |
Bonjour toutes & tous, j'ai une erreur persistante dans un de mes modules lors du 'link', que je n'arrive pas à supprimer, même en ayant recréé totalement.
Ci-dessous les injures que me retourne le générateur de Code::Blocks 16.1. Je suis sous Ubuntu 16.04 LTS, compilateur g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 & wxWidgets 3.0.3 :
Code Cpp:-------------- Nettoyer: Debug in pmGenealogie (compiler: GNU GCC Compiler)--------------- Cleaned "pmGenealogie - Debug" -------------- Générer: Debug in pmGenealogie (compiler: GNU GCC Compiler)--------------- g++ -Wall -std=c++11 -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -g -c /home/patrick/CBProjects/pmGenealogie/sources/DoSearchFMAFI.cpp -o obj/sources/DoSearchFMAFI.o g++ -Wall -std=c++11 -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -g -c /home/patrick/CBProjects/pmGenealogie/sources/DoSettings.cpp -o obj/sources/DoSettings.o g++ -Wall -std=c++11 -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -g -c /home/patrick/CBProjects/pmGenealogie/sources/MyApp.cpp -o obj/sources/MyApp.o g++ -Wall -std=c++11 -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -g -c /home/patrick/CBProjects/pmGenealogie/sources/MyFrame.cpp -o obj/sources/MyFrame.o g++ -o pmGenealogie obj/sources/DoSearchFMAFI.o obj/sources/DoSettings.o obj/sources/MyApp.o obj/sources/MyFrame.o -L/usr/local/lib -pthread -lwx_gtk3u-3.0 /usr/local/lib/libwxcode_gtk3u_wxsqlite3-3.0.so obj/sources/MyFrame.o : Dans la fonction « MyFrame::onSearch(wxCommandEvent&) » : /home/patrick/CBProjects/pmGenealogie/sources/MyFrame.cpp:246 : référence indéfinie vers « DoSearchFMAFF::DoSearchFMAFF(wxWindow*) » obj/sources/MyFrame.o : Dans la fonction « DoSearchFMAFF::~DoSearchFMAFF() » : /home/patrick/CBProjects/pmGenealogie/sources/DoSearchFMAFF.h:52 : référence indéfinie vers « vtable for DoSearchFMAFF » collect2: error: ld returned 1 exit status Process terminated with status 1 (0 minute(s), 9 second(s)) 1 error(s), 0 warning(s) (0 minute(s), 9 second(s)) Le contenu de mon MyFrame.h :
Code wxWidgets:/* array for search menu ---------------------------------------------------- */ const wxString arrSearchMenu [] = { _( "Search for missing acts by individual" ), _( "Search for missing acts by family" ), _( "Control on lastnames and forenames"), }; class MyFrame : public wxFrame { public: MyFrame( wxLocale& m_locale, wxLanguage m_lang ); virtual ~MyFrame() {} void onSettings( wxCommandEvent& WXUNUSED( event ) ); void onLoading( wxCommandEvent& WXUNUSED( event ) ); void onSearch( wxCommandEvent& WXUNUSED( event ) ); void onLanguage( wxCommandEvent& WXUNUSED( event ) ); void onHelp( wxCommandEvent& WXUNUSED( event ) ); void onAbout( wxCommandEvent& WXUNUSED( event ) ); void onQuit( wxCommandEvent& WXUNUSED( event ) ); void onClose( wxCloseEvent& WXUNUSED( event ) ); void doCloseApplication(); /* called by onQuit() and onClose() */ wxString convertQuotes( wxString str ); wxString convertDate( wxString str ); private: wxLocale& m_locale; wxLanguage m_lang; wxConfigBase *pConfig; wxStatusBar *pStatBar; wxToolBar *pToolBar; wxSQLite3Database *pSqlite; wxString m_dbName; wxDECLARE_EVENT_TABLE(); }; La partie de mon MyFrame.cpp concernée :
Code wxWidgets:#include "MyFrame.h" #include "../images/wxwidgets.xpm" #include "FindGenewebBases.h" #include "DoSearchFMAFF.h" #include "DoSearchFMAFI.h" #include "DoSettings.h" #include "convertQuotes.hpp" #include "convertDate.hpp" #include "onLoading.hpp" ... void MyFrame::onSearch( wxCommandEvent& WXUNUSED( event ) ) { // formatting language selector int searchMenu = wxGetSingleChoiceIndex( _( "Select the search or the control you want to perform :" ), _( "Research and controls" ), WXSIZEOF( arrSearchMenu ), arrSearchMenu, NULL, wxDefaultCoord, wxDefaultCoord, true ); /// Do Search For Missing Acts For Individuals ----------------------------- if ( searchMenu == 0 ) { /* initialize the dialog vars */ int actsRange = ALL_ACTS_FMAFI; int placeType = ALL_PLACES; wxString placeName = wxEmptyString; /* call the search dialog */ DoSearchFMAFI dialog( this ); /* set the dialog vars */ dialog.setActsRange( actsRange ); dialog.setPlaceType( placeType ); dialog.setPlaceName( placeName ); /* if cancel button has been pressed, exit the search dialog */ if ( dialog.ShowModal() == wxID_CANCEL ) { return; } /* get the dialog vars */ actsRange = dialog.getActsRange(); placeType = dialog.getPlaceType(); placeName = dialog.getPlaceName(); /* formatting the sql request */ wxString query = wxT( "SELECT t1.id, t2.lastname, t2.forename, t2.sex, t1.type, t1.calc, t1.place , t1.source FROM act AS t1 "\ "LEFT OUTER JOIN ind AS t2 ON t2.id = t1.id "\ "WHERE substr(t1.id, 1, 1) = 'I' AND t1.calc <> '' AND t1.place <> '' AND t1.source = '' " ); if ( actsRangeKeyFMAFI[ actsRange ] != wxT( "*" ) ) { query.Append( wxT( "AND t1.type='" ) + actsRangeKeyFMAFI[ actsRange ] + wxT( "' " ) ); } /* add places range selection and name to query */ if ( placeType == PLACES_STARTING_WITH && placeName != wxEmptyString ) { query.Append( wxT( "AND t1.place LIKE '" ) + placeName + wxT( "%' " ) ); } if ( placeType == PLACES_ENDING_WITH && placeName != wxEmptyString ) { query.Append( wxT( "AND t1.place LIKE '%" ) + placeName + wxT( "' " ) ); } if ( placeType == PLACES_CONTAINING && placeName != wxEmptyString ) { query.Append( wxT( "AND t1.place LIKE '%" ) + placeName + wxT( "%' " ) ); } query.Append( wxT( "ORDER BY t1.place, t2.lastname, t2.forename;" ) ); /* execute the query */ wxSQLite3ResultSet result = pSqlite->ExecuteQuery( query ); } /// Do Search For Missing Acts For Families -------------------------------- if ( searchMenu == 1 ) { /* initialize the dialog vars */ int actsRange = ALL_ACTS_FMAFF; int placeType = ALL_PLACES; wxString placeName = wxEmptyString; /* call the search dialog */ DoSearchFMAFF dialog( this ); /* set the dialog vars */ dialog.setActsRange( actsRange ); dialog.setPlaceType( placeType ); dialog.setPlaceName( placeName ); /* if cancel button has been pressed, exit the search dialog */ if ( dialog.ShowModal() == wxID_CANCEL ) { return; } /* get the dialog vars */ actsRange = dialog.getActsRange(); placeType = dialog.getPlaceType(); placeName = dialog.getPlaceName(); /* formatting the sql request */ wxString query = wxT( "SELECT t1.id, t3.lastname, t3.forename, t4.lastname, t4.Forename, t1.type, t1.calc, t1.place FROM act AS t1 "\ "LEFT OUTER JOIN fam AS t2 ON t2.id = t1.id "\ "LEFT OUTER JOIN ind AS t3 ON t3.id = t2.husb "\ "LEFT OUTER JOIN ind AS t4 ON t4.id = t2.wife "\ "WHERE substr(t1.id, 1, 1) = 'F' AND t1.calc <> '' AND t1.place <> '' AND t1.source='' " ); if ( actsRangeKeyFMAFF[ actsRange ] != wxT( "*" ) ) { query.Append( wxT( "AND t1.type='" ) + actsRangeKeyFMAFF[ actsRange ] + wxT( "' " ) ); } /* add places range selection and name to query */ if ( placeType == PLACES_STARTING_WITH && placeName != wxEmptyString ) { query.Append( wxT( "AND t1.place LIKE '" ) + placeName + wxT( "%' " ) ); } if ( placeType == PLACES_ENDING_WITH && placeName != wxEmptyString ) { query.Append( wxT( "AND t1.place LIKE '%" ) + placeName + wxT( "' " ) ); } if ( placeType == PLACES_CONTAINING && placeName != wxEmptyString ) { query.Append( wxT( "AND t1.place LIKE '%" ) + placeName + wxT( "%' " ) ); } query.Append( wxT( "ORDER BY t1.place, t3.lastname, t3.forename;" ) ); /* execute the query */ wxSQLite3ResultSet result = pSqlite->ExecuteQuery( query ); } } Le contenu de ma classe DoSearchFMAFF :
Code wxWidgets:#include "wx/wx.h" #include "wx/textctrl.h" #include "wx/valgen.h" #include "wx/wxsqlite3.h" /* CAUTION : DO NOT MODIFY THEM AND DO NOT CHANGE THEIR ORDER !!!!!!!!!!!!!!! */ /* acts range family selector */ enum actsRangeEnumFMAFF { ALL_ACTS_FMAFF = 0, /* all families acts */ PUB_ACTS_FMAFF, /* publication acts only */ MAR_ACTS_FMAFF, /* marriage acts only */ DIV_ACTS_FMAFF, /* divorce acts only */ }; const wxString actsRangeKeyFMAFF[] = { wxT( "*" ), wxT( "MARB" ), wxT( "MARR" ), wxT( "DIV " ), }; const wxString actsRangeValFMAFF[] = { _( "All acts" ), _( "Publications" ), _( "Marriages" ), _( "Divorces" ), }; /* the 2 arrays above must be synchronized */ wxCOMPILE_TIME_ASSERT( WXSIZEOF( actsRangeKeyFMAFF ) == WXSIZEOF( actsRangeValFMAFF ), actsRangeMismatchFMAFF ); class DoSearchFMAFF : public wxDialog { public: DoSearchFMAFF( wxWindow* parent ); void createControls(); void onPlaceType( wxUpdateUIEvent& ); /* acts range ind accessors */ int getActsRange() const { return m_actsRange; } void setActsRange( const int& actsRange ) { m_actsRange = actsRange; } /* acts place accessors */ int getPlaceType() const { return m_placeType; } void setPlaceType( const int& placeType ) { m_placeType = placeType; } /* place name accessors */ wxString getPlaceName() const { return m_placeName; } void setPlaceName( const wxString& placeName ) { m_placeName = placeName; } private: int m_actsRange; int m_placeType; wxString m_placeName; wxStaticBoxSizer *actsSizer; wxStaticBoxSizer *placeSizer; wxChoice *actsRangeSelector; wxChoice *placeTypeSelector; wxTextCtrl *placeNameControl; wxDECLARE_EVENT_TABLE(); }; et le contenu de DoSearchFMAFF.cpp :
Code wxWidgets:#include "MyFrame.h" #include "DoSearchFMAFF.h" wxBEGIN_EVENT_TABLE( DoSearchFMAFF, wxDialog ) EVT_UPDATE_UI( ID_ACTS_PLACE, DoSearchFMAFF::onPlaceType ) wxEND_EVENT_TABLE() /// DoSearchFMAFF : DoSearchFMAFF -------------------------------------------------- DoSearchFMAFF::DoSearchFMAFF( wxWindow *parent ) : wxDialog( parent, wxID_ANY, _( "Select the search criteria" ), wxDefaultPosition, wxDefaultSize ) { m_actsRange = ALL_ACTS_FMAFF; m_placeType = ALL_PLACES; m_placeName = wxEmptyString; createControls(); GetSizer()->Fit( this ); Center(); } /// DoSearchFMAFF : createControls() ------------------------------------------- void DoSearchFMAFF::createControls() { /* main box sizer */ wxBoxSizer *mainSizer = new wxBoxSizer( wxVERTICAL ); SetSizer( mainSizer ); /* top box sizer for selection control */ wxBoxSizer *topSizer = new wxBoxSizer( wxHORIZONTAL ); mainSizer->Add( topSizer, 0, wxALL | wxALIGN_CENTRE_HORIZONTAL, 5 ); /* static box sizer for all types and ranges acts */ actsSizer = new wxStaticBoxSizer( wxHORIZONTAL, this, _( "Select the range of acts : " ) ); topSizer->Add( actsSizer, 0, wxALIGN_CENTRE_VERTICAL | wxALL, 5 ); /* acts range selector */ actsRangeSelector = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxSize( 140, 30 ), WXSIZEOF( actsRangeValFMAFF ), actsRangeValFMAFF, 0, wxGenericValidator( &m_actsRange ) ); actsRangeSelector->SetSelection( m_actsRange ); actsSizer->Add( actsRangeSelector, 0, wxALIGN_CENTRE_VERTICAL | wxALL, 5 ); topSizer->AddSpacer( 20 ); /* static box sizer for acts place and name place */ placeSizer = new wxStaticBoxSizer( wxHORIZONTAL, this, _( " Select the range of places : " ) ); topSizer->Add( placeSizer, 0, wxALIGN_CENTRE_VERTICAL | wxALL, 5 ); /* place range selector */ placeTypeSelector = new wxChoice( this, ID_ACTS_PLACE, wxDefaultPosition, wxSize( 180, 30), WXSIZEOF( placeTypeVal ), placeTypeVal, 0, wxGenericValidator( &m_placeType ) ); placeTypeSelector->SetSelection( m_placeType ); placeSizer->Add( placeTypeSelector, 0, wxALIGN_CENTRE_VERTICAL | wxALL, 5 ); /* place name input */ placeNameControl = new wxTextCtrl( this, wxID_ANY, m_placeName, wxDefaultPosition, wxSize( 250, 30 ), 0, wxTextValidator( wxFILTER_NONE, &m_placeName ) ); placeSizer->Add( placeNameControl, 0, wxALIGN_CENTRE_VERTICAL | wxALL, 5 ); topSizer->AddSpacer( 20 ); /* buttonsizer for Ok/Cancel buttons */ wxSizer *buttonSizer = CreateButtonSizer( wxOK | wxCANCEL | wxOK_DEFAULT ); topSizer->Add( buttonSizer, 0, wxALL | wxALIGN_CENTRE, 5 ); mainSizer->SetSizeHints( this ); } /// DoSearchFMAFF : onPlaceType ------------------------------------------------ void DoSearchFMAFF::onPlaceType( wxUpdateUIEvent& ) { if ( placeTypeSelector->GetSelection() == ALL_PLACES ) { placeNameControl->Hide(); } else { placeNameControl->Show(); } }
Si vous pouvez me dépanner, n'hésitez surtout pas, j'en serait l'homme le plus heureux ... Merci par avance. Patrick MULOT.
Dernière modification par PatrickMULOT (21-04-2018 17:57:19)
|
ASUS K73SV - Intel Core i7-2630QM CPU @ 2.00GHz × 8 - Ram 4 Gb - HDD 320+500 Gb Multi-Boot : Ubuntu 16.04 LTS 64 bits - Debian 8.2.0 64 bits - Windows XP3 32 bits " Heureux sont les gens fêlés car ils laissent passer la lumière ..." (Michel AUDIARD)
|
Xaviou (Administrateur)
Lieu: Annecy (74)
Inscrit le : 27-08-2007
Messages: 1383
Snippets: 25
Tutoriels: 6
Site web
Hors ligne |
Salut. Je ne vois rien qui puisse générer de telles erreurs.
Le seul truc bizarre que je constate, c'est que dans ta ligne de commande, tu compiles un fichier "DoSearchFMAFI.cpp" et non "DoSearchFMAF.cpp" : est-ce qu'il pourrait y avoir un quiproquo entre ces deux noms de fichiers ?
@+ Xav'
|
Le nouveau portail wxWidgets francophone : www.wxdev.fr Ben en fait, vous y êtes déjà...
|
PatrickMULOT (Membre)
Lieu: JUMELLES 27220
Inscrit le : 28-01-2016
Messages: 22
Snippets: 0
Tutoriels: 0
Hors ligne |
Non Xaviou, j'ai en fait deux classes : DoSearchFMAFI et DoSearchFMAFF et pour chacune un ficher .h et .cpp; je n'ai présenté que la classe DoSearchFMAFF car c'est elle qui me pose problème. La classe DoSearchFMAFI se compile correctement (voir la première ligne du log de génération ), et dans la portion du fichier MyFrame.cpp, en fait il y a un appel à chacune de ces classes.
Dans la 5ème ligne du log de génération (linkage), il apparaît les fichiers DoSearchFMAFI.o, DoSettings.o, MyApp.o & MyFrame.o. le fichier DoSearchFMAFF.o n'apparaît pas !
Je précise que ces deux classes sont et font un travail similaire; j'ai copié la deuxième à partir de la première et modifié les champs nécessaires. J'espère avoir été assez clair. Patrick MULOT
|
ASUS K73SV - Intel Core i7-2630QM CPU @ 2.00GHz × 8 - Ram 4 Gb - HDD 320+500 Gb Multi-Boot : Ubuntu 16.04 LTS 64 bits - Debian 8.2.0 64 bits - Windows XP3 32 bits " Heureux sont les gens fêlés car ils laissent passer la lumière ..." (Michel AUDIARD)
|
Xaviou (Administrateur)
Lieu: Annecy (74)
Inscrit le : 27-08-2007
Messages: 1383
Snippets: 25
Tutoriels: 6
Site web
Hors ligne |
PatrickMULOT:Dans la 5ème ligne du log de génération (linkage), il apparaît les fichiers DoSearchFMAFI.o, DoSettings.o, MyApp.o & MyFrame.o. le fichier DoSearchFMAFF.o n'apparaît pas ! Il n'apparaît pas non plus dans les précédentes lignes. Le problème vient de là : il n'est pas ajouté au projet Code::Blocks et du coup il n'est pas compilé : d'où les "Undefined reference...".
@+ Xav'
|
Le nouveau portail wxWidgets francophone : www.wxdev.fr Ben en fait, vous y êtes déjà...
|
PatrickMULOT (Membre)
Lieu: JUMELLES 27220
Inscrit le : 28-01-2016
Messages: 22
Snippets: 0
Tutoriels: 0
Hors ligne |
Avec ton explication, j'ai contrôlé les 'properties' du fichier DoSearchFMAFF.cpp, et dans l'onglet Générer, les lignes "Compiler le fichier" et "Lier le fichier" n'étaient pas cochées. Je les ai cochées et j'ai recompilé le tout. Maintenant ça roule. çà fait deux jours que je planche dessus, et jamais je n'ai eu l'idée d'aller voir dans ces propriétés. Merci Xaviou et sincèrement désolé de t'avoir dérangé pour cela. Encore merci. Patrick MULOT.
|
ASUS K73SV - Intel Core i7-2630QM CPU @ 2.00GHz × 8 - Ram 4 Gb - HDD 320+500 Gb Multi-Boot : Ubuntu 16.04 LTS 64 bits - Debian 8.2.0 64 bits - Windows XP3 32 bits " Heureux sont les gens fêlés car ils laissent passer la lumière ..." (Michel AUDIARD)
|
Xaviou (Administrateur)
Lieu: Annecy (74)
Inscrit le : 27-08-2007
Messages: 1383
Snippets: 25
Tutoriels: 6
Site web
Hors ligne |
Pas de soucis.
@+ Xav'
|
Le nouveau portail wxWidgets francophone : www.wxdev.fr Ben en fait, vous y êtes déjà...
|
|