Code: Select all
.libs/libdialogs_la-odbccredentials.o: In function `wxScopedCharTypeBuffer<wchar_t>::GetNullData()':
/home/igor/dbhandler/libdialogs/odbccredentials.cpp:14: multiple definition of `ODBCCredentials::ODBCCredentials(wxWindow*, int, wxString const&, wxString const&, wxString const&, wxString const&, wxPoint const&, wxSize const&, long)'
.libs/libdialogs_la-odbccredentials.o:/home/igor/dbhandler/libdialogs/odbccredentials.cpp:14: first defined here
.libs/libdialogs_la-odbccredentials.o: In function `ODBCCredentials::set_properties()':
/home/igor/dbhandler/libdialogs/odbccredentials.cpp:30: multiple definition of `ODBCCredentials::set_properties()'
.libs/libdialogs_la-odbccredentials.o:/home/igor/dbhandler/libdialogs/odbccredentials.cpp:30: first defined here
.libs/libdialogs_la-odbccredentials.o: In function `ODBCCredentials::do_layout()':
/home/igor/dbhandler/libdialogs/odbccredentials.cpp:38: multiple definition of `ODBCCredentials::do_layout()'
.libs/libdialogs_la-odbccredentials.o:/home/igor/dbhandler/libdialogs/odbccredentials.cpp:38: first defined here
.libs/libdialogs_la-odbccredentials.o: In function `wxScopedCharTypeBuffer<wchar_t>::GetNullData()':
/home/igor/dbhandler/libdialogs/odbccredentials.cpp:14: multiple definition of `ODBCCredentials::ODBCCredentials(wxWindow*, int, wxString const&, wxString const&, wxString const&, wxString const&, wxPoint const&, wxSize const&, long)'
.libs/libdialogs_la-odbccredentials.o:/home/igor/dbhandler/libdialogs/odbccredentials.cpp:14: first defined here
.libs/libdialogs_la-odbccredentials.o: In function `ODBCCredentials::GetUserIDControl()':
/home/igor/dbhandler/libdialogs/odbccredentials.cpp:74: multiple definition of `ODBCCredentials::GetUserIDControl()'
.libs/libdialogs_la-odbccredentials.o:/home/igor/dbhandler/libdialogs/odbccredentials.cpp:74: first defined here
.libs/libdialogs_la-odbccredentials.o: In function `ODBCCredentials::GetPasswordControl()':
/home/igor/dbhandler/libdialogs/odbccredentials.cpp:79: multiple definition of `ODBCCredentials::GetPasswordControl()'
.libs/libdialogs_la-odbccredentials.o:/home/igor/dbhandler/libdialogs/odbccredentials.cpp:79: first defined here
collect2: error: ld returned 1 exit status
The code for the class is following:
Code: Select all
#ifndef ODBCCREDENTIALS_H
#define ODBCCREDENTIALS_H
class ODBCCredentials: public wxDialog
{
public:
// begin wxGlade: ODBCCredentials::ids
// end wxGlade
ODBCCredentials(wxWindow *parent, wxWindowID id, const wxString& title, const wxString &dsn, const wxString &userID, const wxString &password, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
const wxTextCtrl &GetUserIDControl();
const wxTextCtrl &GetPasswordControl();
private:
wxString m_dsn;
// begin wxGlade: ODBCCredentials::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: ODBCCredentials::attributes
wxPanel *m_panel;
wxStaticText* label_1;
wxTextCtrl* m_userID;
wxStaticText* label_2;
wxTextCtrl* m_password;
// end wxGlade
}; // wxGlade: end class
#endif // ODBCCREDENTIALS_H
Code: Select all
#include <wx/wx.h>
#include "odbccredentials.h"
ODBCCredentials::ODBCCredentials(wxWindow *parent, wxWindowID id, const wxString& title, const wxString &dsn, const wxString &userID, const wxString &password, const wxPoint& pos, const wxSize& size, long style):
wxDialog(parent, id, title, pos, size, wxCAPTION)
{
m_dsn = dsn;
// begin wxGlade: ODBCCredentials::ODBCCredentials
m_panel = new wxPanel( this, wxID_ANY );
label_1 = new wxStaticText( this, wxID_ANY, _( "User ID" ) );
m_userID = new wxTextCtrl( this, wxID_ANY, userID );
label_2 = new wxStaticText( this, wxID_ANY, _( "Password" ) );
m_password = new wxTextCtrl( this, wxID_ANY, password, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
set_properties();
do_layout();
// end wxGlade
}
void ODBCCredentials::set_properties()
{
// begin wxGlade: ODBCCredentials::set_properties
SetTitle( _( "Connecting to " ) + m_dsn );
// end wxGlade
}
void ODBCCredentials::do_layout()
{
// begin wxGlade: ODBCCredentials::do_layout
wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* sizer_1 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* sizer_2 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* sizer_3 = new wxBoxSizer( wxVERTICAL );
wxStdDialogButtonSizer *m_stdbuttonsizer = new wxStdDialogButtonSizer();
m_stdbuttonsizer->AddButton( new wxButton( m_panel, wxID_OK, _( "OK" ) ) );
m_stdbuttonsizer->AddButton( new wxButton( m_panel, wxID_CANCEL, _( "Cancel" ) ) );
m_stdbuttonsizer->Realize();
wxFlexGridSizer* grid_sizer_1 = new wxFlexGridSizer( 2, 2, 5, 5 );
grid_sizer_1->AddGrowableCol( 1, 1 );
sizer_1->Add( 5, 5, 0, wxEXPAND, 0 );
sizer_2->Add( 5, 5, 0, wxEXPAND, 0 );
grid_sizer_1->Add( label_1, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 0 );
grid_sizer_1->Add( m_userID, 1, wxEXPAND, 0 );
grid_sizer_1->Add( label_2, 0, 0, 0 );
grid_sizer_1->Add( m_password, 1, wxEXPAND, 0 );
sizer_3->Add( grid_sizer_1, 1, wxEXPAND, 0 );
sizer_3->Add( 5, 5, 0, wxEXPAND, 0 );
sizer_3->Add( m_stdbuttonsizer, 1, wxALIGN_RIGHT, 0 );
sizer_2->Add( sizer_3, 1, 0, 0 );
sizer_2->Add( 5, 5, 0, wxEXPAND, 0 );
sizer_1->Add( sizer_2, 1, 0, 0 );
sizer_1->Add( 5, 5, 0, wxEXPAND, 0 );
m_panel->SetSizer( sizer_1 );
sizer->Add( m_panel, 0, wxEXPAND, 0 );
SetSizer( sizer );
sizer->Fit( this );
Layout();
wxSize size = GetMinSize();
SetMinSize( wxSize( size.GetWidth() * 3, size.GetHeight() ) );
// end wxGlade
}
const wxTextCtrl &ODBCCredentials::GetUserIDControl()
{
return *m_userID;
}
const wxTextCtrl &ODBCCredentials::GetPasswordControl()
{
return *m_password;
}
Thank you.
Makefile:505: recipe for target 'libdialogs.la' failed
make[2]: *** [libdialogs.la] Error 1
make[2]: Leaving directory '/home/igor/dbhandler/Debug/libdialogs'
Makefile:501: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/igor/dbhandler/Debug'
Makefile:412: recipe for target 'all' failed
make: *** [all] Error 2