User forums > Using Code::Blocks
Help setting up wxWidgets
Xorlium:
Hello everyone.
I'm trying to learn how to use wxWidgets using www.3dbuzz.com C++ Video training. They show you how to install wxwidgets, and what you need to do before using it. The thing is, they use Visual Studio, not Code::Blocks, and I can't exactly follow along the setup.
At some point in time, they go to "Project Properties->C/C++->Preprocesor" and then add:
wxUSE_GUI=1; _WXDEBUG_; WXDEBUG=1
And I can't find "preprocesor" anywhere on codeblocks :)
I tried going along, but... let me show you my code.
--- Code: ---
#include "wx/wx.h"
class HelloWorldApp : wxApp
{
public:
virtual bool OnInit();
};
IMPLEMENT_APP(HelloWorldApp)
bool HelloWorldApp::OnInit()
{
wxFrame *frame = new wxFrame((wxFrame *) NULL, -1, _T("Hello World!"), wxPoint(60,70), wxSize(500,600));
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
--- End code ---
if I try to compile it, it gives me this error:
'wxAppConsole is an inaccessible base of HelloWorldApp', and it says it's on the
IMPLEMENT_APP(HelloWorldApp) line, so I imagine it has something to do with the preprocesor. I don't know, though.
Can someone help me?
Thanks!!
mandrav:
--- Quote ---At some point in time, they go to "Project Properties->C/C++->Preprocesor" and then add:
wxUSE_GUI=1; _WXDEBUG_; WXDEBUG=1
And I can't find "preprocesor" anywhere on codeblocks
--- End quote ---
It's "Project->Build options->Compiler options->Compiler definitions" :)
Oh, and enter them one-per line like this:
--- Code: ---wxUSE_GUI=1
_WXDEBUG_
WXDEBUG=1
--- End code ---
Yiannis.
Xorlium:
Thanks!
But still, I got the error... :D any ideas?
At some point, they use "wxmswd.lib", and I didn't find that in my computer. I added "wxmsw242.dll" that was in the codeblocks dir :D
Any ideas?
I have wxwidgets 2.6, and MinGW.
Xorlium:
dumb me, i'm missing a ;
Anyway, it still doesn't work. It now tells me "variable 'vtable for wxFrame' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details."
But that just means I have to read a little...
mandrav:
--- Quote ---At some point, they use "wxmswd.lib", and I didn't find that in my computer. I added "wxmsw242.dll" that was in the codeblocks dir
--- End quote ---
Put libwxmsw24.a (or libwxmsw242.a?) in linker options, not wxmsw242.dll
Yiannis.
Navigation
[0] Message Index
[#] Next page
Go to full version