Code::Blocks Forums

User forums => Help => Topic started by: Manatax on January 15, 2009, 02:48:16 am

Title: Need help getting wxwidget into C::B
Post by: Manatax on January 15, 2009, 02:48:16 am
Hi everyone. I'm the classic noob to the GUI design area, but the design for my g/f's thesis has made it a must for me A.S.A.P. So... before I can go rampage over the tutorials, I need to put what appears to be a promising library into my trusted C::B

My development will be done over:
Windows XP
Code::Blocks 8.02
wxWidgets 2.8.9

I tried to follow every installation tutorial I could find, but it seems i'm a little tooo noob into this.

I just want to know how to do the entire thing.

I tried this >> http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef)
but I got the following error

Code
||=== Tesis, Debug ===|
D:\CodeBlocks\wxWidgets\include\wx\platform.h|196|wx/setup.h: No such file or directory|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|103|#error "wxUSE_DYNLIB_CLASS must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|111|#error "wxUSE_EXCEPTIONS must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|119|#error "wxUSE_FILESYSTEM must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|127|#error "wxUSE_FS_ARCHIVE must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|140|#error "wxUSE_DYNAMIC_LOADER must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|148|#error "wxUSE_LOG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|156|#error "wxUSE_LONGLONG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|164|#error "wxUSE_MIMETYPE must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|180|#error "wxUSE_PRINTF_POS_PARAMS must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|188|#error "wxUSE_PROTOCOL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|230|#error "wxUSE_REGEX must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|238|#error "wxUSE_STDPATHS must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|246|#error "wxUSE_XML must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|254|#error "wxUSE_SOCKETS must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|262|#error "wxUSE_STREAMS must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|270|#error "wxUSE_STOPWATCH must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|278|#error "wxUSE_TEXTBUFFER must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|286|#error "wxUSE_TEXTFILE must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|302|#error "wxUSE_URL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|310|#error "wxUSE_VARIANT must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|330|#error "wxUSE_ABOUTDLG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|338|#error "wxUSE_ACCEL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|346|#error "wxUSE_ANIMATIONCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|354|#error "wxUSE_BITMAPCOMBOBOX must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|362|#error "wxUSE_BMPBUTTON must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|370|#error "wxUSE_BUTTON must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|378|#error "wxUSE_CALENDARCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|386|#error "wxUSE_CARET must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|394|#error "wxUSE_CHECKBOX must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|410|#error "wxUSE_CHOICE must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|418|#error "wxUSE_CHOICEBOOK must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|426|#error "wxUSE_CHOICEDLG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|434|#error "wxUSE_CLIPBOARD must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|442|#error "wxUSE_COLLPANE must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|450|#error "wxUSE_COLOURDLG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|458|#error "wxUSE_COLOURPICKERCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|466|#error "wxUSE_COMBOBOX must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|474|#error "wxUSE_COMBOCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|482|#error "wxUSE_DATAOBJ must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|490|#error "wxUSE_DATAVIEWCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|498|#error "wxUSE_DATEPICKCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|506|#error "wxUSE_DIRPICKERCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|514|#error "wxUSE_DISPLAY must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|522|#error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|530|#error "wxUSE_FILEDLG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|538|#error "wxUSE_FILEPICKERCTRL must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|546|#error "wxUSE_FONTDLG must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|554|#error "wxUSE_FONTMAP must be defined."|
D:\CodeBlocks\wxWidgets\include\wx\chkconf.h|562|#error "wxUSE_FONTPICKERCTRL must be defined."|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

Any help will be appretiated
Title: Re: Need help getting wxwidget into C::B
Post by: stahta01 on January 15, 2009, 04:20:33 am
Did you build wxWidgets? Because your error is the normal one for people who never compiled and linked wxWidgets.

Tim S
Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on January 15, 2009, 01:36:32 pm
Build?? I thought I didn't have too... or at least that was what the tutorial said...

So... how do I go about doing that?

Thank you very much for your help  :D
Title: Re: Need help getting wxwidget into C::B
Post by: Jenna on January 15, 2009, 01:47:59 pm
Build?? I thought I didn't have too... or at least that was what the tutorial said...

So... how do I go about doing that?

Thank you very much for your help  :D
Quote
Build wxWidgets

This step is unnecessary if you are using wxPack

quote from wxWidgets Quickref (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#Build_wxWidgets (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#Build_wxWidgets))

That means if you not use wxpack, you have to configure and build wxWidgets libraries from source.

Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on January 15, 2009, 02:04:14 pm
I actually used wxPack... but It is very likely that I downloaded both in my attempts to make it work... i will follow the tutorial steps to compile the library and let you know.
Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on January 15, 2009, 05:46:27 pm
Well... that was easy  :shock: It appears I was not actually useing the pack... now I am... and it works... Thank you very much guys  :D
Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on February 06, 2009, 06:03:03 pm
Ok... so.. I've been using the 4 files that CB created for me as a wxWidget project and all seems to be working fine... the thing is... I'm trying some tutorials and for some reason CB does not find the librarys for single files (as oposite from wx projects).

this tutorial example:

Code
#include <wx/file.h>

int main(int argc, char **argv)
{

  wxString str = wxT("You make me want to be a better man.\n");

  wxFile file;
  file.Create(wxT("quote"), true);

  if (file.IsOpened())
      wxPuts(wxT("the file is opened"));

  file.Write(str);
  file.Close();

  if (!file.IsOpened())
      wxPuts(wxT("the file is not opened"));
}

Produces this error msg:
Code
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|1|wx/file.h: No such file or directory|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp||In function `int main(int, char**)':|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|6|error: `wxString' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|6|error: expected `;' before "str"|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|8|error: `wxFile' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|8|error: expected `;' before "file"|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|9|error: `file' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|9|error: `wxT' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|12|error: `wxPuts' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|14|error: `str' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|18|error: `wxPuts' was not declared in this scope|
||=== Build finished: 10 errors, 0 warnings ===|

Can I get some help on this one plz?  :(
Title: Re: Need help getting wxwidget into C::B
Post by: Jenna on February 06, 2009, 09:46:43 pm
Look at the wizard created projects build options.

It gives you a hint how to specify the correct include dirs and link to the appropriate libs.

Of course the exact paths and libs to be included depend on the wxWidgets flavour(s) you have installed (Debug, Release monolithic, shared, static ...).

But what you need exactly goes beyond the scope of the C::B forum and should be asked in an appropriate forum (like the wxWidgets one).
Title: Re: Need help getting wxwidget into C::B
Post by: dmoore on February 06, 2009, 10:26:27 pm
Ok... so.. I've been using the 4 files that CB created for me as a wxWidget project and all seems to be working fine... the thing is... I'm trying some tutorials and for some reason CB does not find the librarys for single files (as oposite from wx projects).

C::B wxWidgets projects add all of the necessary boilerplate (include directories/libs/flags etc.), which obviously won't be applied to single files that are outside of the project. As Jens says, look at the build options for a C::B created wxwidgets project ... THEN... copy them across to Settings -> Compiler and Debugger, which will then apply them globally. Keep in mind that will mean those directories, libs and flags will be applied to any project and any single file compiled (but you could create a copy of the default compiler for this purpose)
Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on February 06, 2009, 10:33:35 pm
I am doing sorta that right now, but I still have issues

(I'm applying the properties to the new empty project)

Compiler Settings:
> Other Options:
>> -pipe
>> -mthreads
>> [[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]
> #defines:
>> __GNUWIN32__
>> __WXMSW__
>> WXUSINGDLL
>> wxUSE_UNICODE
Search Directories:
> Compiler:
>> D:\CodeBlocks\wxWidgets\include
>> D:\CodeBlocks\wxWidgets\contrib\include
> Resource Compiler
>> D:\CodeBlocks\wxWidgets\include

But I get this:

Code
||=== Test, Debug ===|
obj\Debug\createfile.o:createfile.cpp:(.text+0xa6)||undefined reference to `__imp___ZN6wxFile6CreateEPKwbi'|
obj\Debug\createfile.o:createfile.cpp:(.text+0xcf)||undefined reference to `__imp__wxConvUTF8'|
obj\Debug\createfile.o:createfile.cpp:(.text+0xf9)||undefined reference to `__imp___ZN6wxFile5CloseEv'|
obj\Debug\createfile.o:createfile.cpp:(.text$_ZN6wxFileD1Ev[wxFile::~wxFile()]+0xd)||undefined reference to `__imp___ZN6wxFile5CloseEv'|
)]+0x4a)||undefined reference to `__imp___ZNK8wxString6mb_strERK8wxMBConv'|
)]+0xb5)||undefined reference to `__imp___ZN6wxFile5WriteEPKvj'|
)]+0x7)||undefined reference to `__imp___ZN12wxStringBase4nposE'|
)]+0x27)||undefined reference to `__imp___ZN12wxStringBase8InitWithEPKwjj'|
||=== Build finished: 8 errors, 0 warnings ===|

Jens @ I know I could probably get some help from their forum... but I thought that maybe someone in here with experience in C::B could be more useful than someone with knowledge of the librarys. Thanx for the help anyways :)
Title: Re: Need help getting wxwidget into C::B
Post by: Jenna on February 06, 2009, 10:38:46 pm
What about the linker settings ?
Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on February 06, 2009, 11:03:30 pm
There was nothing there...
Title: Re: Need help getting wxwidget into C::B
Post by: Jenna on February 06, 2009, 11:10:08 pm
There was nothing there...
That's most likely not correct.

Please look also in the target settings, not only in the settings global for the project (Debug and Release use different libs).
Title: Re: Need help getting wxwidget into C::B
Post by: Manatax on February 06, 2009, 11:12:09 pm
I see... I was only looking at the project stuff... i'll do the debug and release and hope it will do the trick
Title: Re: Need help getting wxwidget into C::B
Post by: dmoore on February 06, 2009, 11:14:41 pm
I see... I was only looking at the project stuff... i'll do the debug and release and hope it will do the trick

you can't have both debug and release - choose one or the other (I personally don't use wx debug libs)
Title: Re: Need help getting wxwidget into C::B
Post by: Jenna on February 06, 2009, 11:20:57 pm
I see... I was only looking at the project stuff... i'll do the debug and release and hope it will do the trick

Be aware that you can not use the debug and release libs in one target, you can use them for debug and release target.
You can use the same libs for both targets unless you want to debug wxWidgets.