
|
|
Auteur
|
Message
|
1
|
|
|
|
Bonjour,
Débutant (presque ) autodidacte, après m'être amuser à de petits programmes de calculs statistiques en C, j'ai cherché à présenter autrement qu'en mode console. J'utilise DevC++ et je suis donc passé à la version wxDevC++ pour faire de belles interfaces graphiques...
... mais voilà, mêmes les sources des exemples du Devpack wxwidgets 2.7.1 proposés présentent 2km de messages lors de la compilation... alors que les instructions d'install/configuration wxDevC++ et packages ont été scrupuleusement suivi point par point et se sont très bien passés.
Quelqu'un a-t-il rencontré le souci et surtout trouvé une soluce ?
Précision sur la config :
XPSP2 à jour, antivirus + antispyware à jour, peu d'applications installées
edit :
log de compilation :
Compilateur: Default compiler
Building Makefile: "C:\Dev-Cpp\wx\samples\artprov\Makefile.win"
Finding dependencies for file: C:\Dev-Cpp\wx\samples\artprov\artbrows.cpp
Finding dependencies for file: C:\Dev-Cpp\wx\samples\artprov\arttest.cpp
Exécution de make...
make.exe -f "C:\Dev-Cpp\wx\samples\artprov\Makefile.win" all
g++.exe -c artbrows.cpp -o artbrows.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include/wx/msw" -I"C:/Dev-Cpp/include/wx/generic" -I"C:/Dev-Cpp/include/wx/animate" -I"C:/Dev-Cpp/include/wx/fl" -I"C:/Dev-Cpp/include/wx/gizmos" -I"C:/Dev-Cpp/include/wx/html" -I"C:/Dev-Cpp/include/wx/mmedia" -I"C:/Dev-Cpp/include/wx/net" -I"C:/Dev-Cpp/include/wx/ogl" -I"C:/Dev-Cpp/include/wx/plot" -I"C:/Dev-Cpp/include/wx/protocol" -I"C:/Dev-Cpp/include/wx/stc" -I"C:/Dev-Cpp/include/wx/svg" -I"C:/Dev-Cpp/include/wx/xml" -I"C:/Dev-Cpp/include/wx/xrc" -I"C:/Dev-Cpp/include/wx" -fno-rtti -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -fexpensive-optimizations -O3
In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
from C:/Dev-Cpp/include/wx/memory.h:33,
from C:/Dev-Cpp/include/wx/object.h:20,
from C:/Dev-Cpp/include/wx/wx.h:16,
from artbrows.cpp:24:
C:/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
artbrows.cpp:121: error: `wxID_ANY' was not declared in this scope
artbrows.cpp:122: error: `wxID_ANY' was not declared in this scope
artbrows.cpp: In constructor `wxArtBrowserDialog::wxArtBrowserDialog(wxWindow*)':
artbrows.cpp:126: error: `wxID_ANY' undeclared (first use this function)
artbrows.cpp:126: error: (Each undeclared identifier is reported only once for each function it appears in.)
artbrows.cpp: In member function `void wxArtBrowserDialog::SetArtClient(const wxArtClient&)':
artbrows.cpp:184: error: 'class wxListCtrl' has no member named 'AssignImageList'
make.exe: *** [artbrows.o] Error 1
Exécution terminée
Pour les warning, il suffit d'ajouter -Wno-deprecated dans Outils/options du compilateur/ajouter les commandes suivantes lors de l'appel au compilateur.
Par contre pour les déclarations, j'ai besoin d'un coup de main. Voilà le code artbrows.cpp :
#include "null.xpm"
BEGIN_EVENT_TABLE(wxArtBrowserDialog, wxDialog)
EVT_LIST_ITEM_SELECTED(wxID_ANY, wxArtBrowserDialog::OnSelectItem)
EVT_CHOICE(wxID_ANY, wxArtBrowserDialog::OnChooseClient)
END_EVENT_TABLE()
wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
: wxDialog(parent, wxID_ANY, _T("Art resources browser"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxSizer *subsizer;
wxChoice *choice = new wxChoice(this, wxID_ANY);
FillClients(choice);
subsizer = new wxBoxSizer(wxHORIZONTAL);
subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
subsizer->Add(choice, 1, wxLEFT, 5);
sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10);
subsizer = new wxBoxSizer(wxHORIZONTAL);
m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300),
wxLC_REPORT | wxSUNKEN_BORDER);
m_list->InsertColumn(0, _T("wxArtID"));
subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10);
wxSizer *subsub = new wxBoxSizer(wxVERTICAL);
m_text = new wxStaticText(this, wxID_ANY, wxT("Size: 333x333"));
subsub->Add(m_text);
m_canvas = new wxStaticBitmap(this, wxID_ANY, wxBitmap(null_xpm));
subsub->Add(m_canvas);
subsub->Add(100, 100);
subsizer->Add(subsub);
sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10);
wxButton *ok = new wxButton(this, wxID_OK, _T("Close"));
ok->SetDefault();
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
SetSizer(sizer);
sizer->Fit(this);
choice->SetSelection(6/*wxART_MESSAGE_BOX*/);
SetArtClient(wxART_MESSAGE_BOX);
}
void wxArtBrowserDialog::SetArtClient(const wxArtClient& client)
{
wxBusyCursor bcur;
wxImageList *img = new wxImageList(16, 16);
img->Add(wxIcon(null_xpm));
int index = 0;
long sel = m_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED);
if (sel < 0) sel = 0;
m_list->DeleteAllItems();
FillBitmaps(img, m_list, index, client, wxSize(16, 16));
m_list->AssignImageList(img, wxIMAGE_LIST_SMALL);
m_list->SetColumnWidth(0, wxLIST_AUTOSIZE);
m_list->SetItemState(sel, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
m_client = client;
SetArtBitmap((const wxChar*)m_list->GetItemData(sel), m_client);
}
void wxArtBrowserDialog::OnSelectItem(wxListEvent &event)
{
const wxChar *data = (const wxChar*)event.GetData();
SetArtBitmap(data, m_client, wxDefaultSize);
}
void wxArtBrowserDialog::OnChooseClient(wxCommandEvent &event)
{
const wxChar *data = (const wxChar*)event.GetClientData();
SetArtClient(data);
}
void wxArtBrowserDialog::SetArtBitmap(const wxArtID& id, const wxArtClient& client, const wxSize& size)
{
wxBitmap bmp = wxArtProvider::GetBitmap(id, client, size);
m_canvas->SetSize(bmp.GetWidth(), bmp.GetHeight());
m_canvas->SetBitmap(bmp);
m_text->SetLabel(wxString::Format(wxT("Size: %d x %d"), bmp.GetWidth(), bmp.GetHeight()));
Refresh();
}
-->Message édité par otodidact le 30/11/2006 02:06:12<--
|
|
1
|
|

|


|