User forums > Using Code::Blocks
wxsmith - fatal error wx/dialog.h: no such file or directory
blue orb:
Hi, so i am new to c++ and therefore code::blocks... have done a lot of googling and have managed to learn quite alot. generally, i am happy with my progress to date. i am using the MinGw 64-bit compiler. my system is windows 7 64-bit home premium. eventually, i want to build a RPG gui-based game. i've been using the wxsmith gui building tools to get a feel for it. building the gui isn't a major problem. i have a project with a main.ccp an other.cpp and a header.h file. with them, there are the two files that i have cut and pasted below = they are the gui files (one .ccp and the other a .h header file). now, all is okay until i try to compile the thing... the compiler gives me the fatal warning stating that there are missing files/directories.
is this because i haven't developed the gui facets enough? i don't think that is the problem here. if only things just worked... any help is good help, i think. thanks for any advice you might be able to offer.
MyDialog.cpp
---------------
#include "MyDialog.h"
//(*InternalHeaders(MyDialog)
#include <wx/intl.h>
#include <wx/string.h>
//*)
//(*IdInit(MyDialog)
const long MyDialog::ID_SPINBUTTON1 = wxNewId();
//*)
BEGIN_EVENT_TABLE(MyDialog,wxDialog)
//(*EventTable(MyDialog)
//*)
END_EVENT_TABLE()
MyDialog::MyDialog(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
//(*Initialize(MyDialog)
Create(parent, id, _("Bass"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
SetClientSize(wxSize(800,600));
Move(wxPoint(100,100));
SetBackgroundColour(wxColour(129,130,94));
SpinButton1 = new wxSpinButton(this, ID_SPINBUTTON1, wxPoint(208,216), wxDefaultSize, wxSP_VERTICAL|wxSP_ARROW_KEYS, _T("ID_SPINBUTTON1"));
SpinButton1->SetRange(0, 100);
//*)
}
MyDialog::~MyDialog()
{
//(*Destroy(MyDialog)
//*)
}
MyDialog.h
-------------
#ifndef MYDIALOG_H
#define MYDIALOG_H
//(*Headers(MyDialog)
#include <wx/dialog.h>
#include <wx/spinbutt.h>
//*)
class MyDialog: public wxDialog
{
public:
MyDialog(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
virtual ~MyDialog();
//(*Declarations(MyDialog)
wxSpinButton* SpinButton1;
//*)
protected:
//(*Identifiers(MyDialog)
static const long ID_SPINBUTTON1;
//*)
private:
//(*Handlers(MyDialog)
//*)
DECLARE_EVENT_TABLE()
};
#endif
Thanks :)
Alpha:
It sounds like you do not have the wxWidgets library (properly) installed/setup. Refer to the documentation of how to do this on the Code::Blocks wiki (or possibly more up-to-date for building, the wxWidgets wiki).
By the way, whenever posting code or logs of some sort, please use code tags.
blue orb:
hello, i had wxWidgets 2.8.12 installed on my system, but i couldn't find any way to run it = no icon, or wotnot. how can i launch it? i have just installed wxWidgets 2.9.2 and, again, no icon or anything to launch the application... how is it done? from within code::blocks?
zabzonk:
wxWidgets is not an application. It's a library, and one that must be built and then linked with your application. Building wxWidgets on Windows is a bit fraught, so you may want to use the pre-compiled version which you can get from wxPack at http://wxpack.sourceforge.net.
Also, for a beginner programmer I would not recommend using the 64-bit version of MinGW. Just because your platform is notionally 64-bit does not mean that you have to use a 64-bit compiler. Use the 32-bit one at http://tdm-gcc.tdragon.net
blue orb:
after a complete re-install of code::blocks, i am back using minGW 32-bit. now, the 32-bit version is throwing-up lots more errors than minGW 64-bit did. do i need to configure wxsmith for current project? i didn't want to tamper with its settings too much. other than that, the settings ==> global variables ==> builtin fields?
--- Code: ---[code||=== bass, Debug ===|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|6|error: wx/dialog.h: No such file or directory|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|7|error: wx/spinbutt.h: No such file or directory|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|8|error: wx/combobox.h: No such file or directory|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.cpp|4|error: wx/intl.h: No such file or directory|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.cpp|5|error: wx/string.h: No such file or directory|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|12|error: expected class-name before '{' token|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|15|error: expected ')' before '*' token|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|19|error: ISO C++ forbids declaration of 'wxSpinButton' with no type|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|19|error: expected ';' before '*' token|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|20|error: ISO C++ forbids declaration of 'wxComboBox' with no type|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|20|error: expected ';' before '*' token|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|35|error: ISO C++ forbids declaration of 'DECLARE_EVENT_TABLE' with no type|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|36|error: expected ';' before '}' token|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.h|36|error: expected ';' before '}' token|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.cpp|9|error: 'wxNewId' was not declared in this scope|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.cpp|10|error: 'wxNewId' was not declared in this scope|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.cpp|13|error: 'wxDialog' has not been declared|
I:\My Documents\CodeBlocks C++\bass - Copy (3)\MyDialog.cpp|16|error: expected constructor, destructor, or type conversion before 'END_EVENT_TABLE'|
||=== Build finished: 18 errors, 0 warnings ===|
]
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version