User forums > Help

Setting up code blocks so that I can compile wxwidgets programs.

<< < (5/10) > >>

thomas:
You have to include *both* the include directory under your wxWidgets folder and \lib\gcc_dll\mswu_or_whatever_your_build, as the compiler will need
1. include files from within the include directory
2. the file setup.h which is in a subdirectory of your library folder

The "good" way of doing this is to use the wx global variable (see the WiKi for more information on this subject) and set those paths relative to it, since then your project is arbitrarily relocateable (setting the variable alone is not sufficient, of course).

The template coming with Code::Blocks does that correctly, so if you start your project from the template, you should be fine.

djsbriscoe:
Hi,
If I want to set up a new wxwidget application as a new project there are 4 options to choose from and I dont know what to choose (something todo with static DLL's etc which I don't understand).
Regarding settings -> global variable I have C:\wxWidgets-2.6.2\ as the base directory. I cant figure out what to put in the include and lib boxes.
Where do I put the path C:\wxWidgets-2.6.2\lib\gcc_dll\mswu\wx (where setup.h is)?
What directories do I put in the directories setting of the settings -> compiler and debugger -> directories box?
Nothing has been set up automatically by the wxwidget template.
What is WX_CFG= used for under build options?
I have looked at the wiki and can't find anything that answers my questions.
I hope someone can clear up my confusion a bit.

Regards,

David.

thomas:

--- Quote from: djsbriscoe on April 13, 2006, 05:06:24 pm ---If I want to set up [...] I dont know what to choose
[...]
Regarding settings -> global variable I have C:\wxWidgets-2.6.2\ as the base directory. I cant figure out what to put in the include and lib boxes.

--- End quote ---
Read my above post, or read the WiKi, both explains in detail what to do.


--- Quote from: djsbriscoe on April 13, 2006, 05:06:24 pm ---Nothing has been set up automatically by the wxwidget template.
--- End quote ---
Why do you say that?

As you can very well see, the template sets up everything just fine:






ptruog:
Can you provide the Tutorial on the codeblocks wiki?  I tried to download the pdf (presumably the tutorial) from that french site and it requires a login etc.. 

mais, je ne parle pas

Many thanks

djsbriscoe:
Hi,
I am still having problems compiling the following wxwidgets program.
Could someone PLEASE help me to figure out what the problem is.
I will supply ANY information thats needed and work with whoever can help me to come
to a resolution for these problems with compiling.

Have I missed out an important step after compiling wxwidgets?
Am I geting all my paths mixed up?
What about any environment variables in windows 2000, what are essential for C:B,mingw and wxwidgets operation?

Any way here is the program I am trying to compile, could someone try it on their setup of C:B and see if it works.
If it doesnt can someone give me an example that works for them so I can try it out,Thanks.

PS I am using C:B version 1 revision 2334.

//Main source file.

#include <wx/wx.h>
#include "basic.h"
IMPLEMENT_APP(BasicApplication)
bool BasicApplication::OnInit()
{
 BasicFrame *frame = new BasicFrame("Basic", 50, 50, 450, 300);
 frame->Show(TRUE);
 SetTopWindow(frame);
 return TRUE;
}
BasicFrame::BasicFrame
(const wxChar *title,
int xpos, int ypos,
int width, int height)
: wxFrame
( (wxFrame *) NULL,
-1,
title,
wxPoint(xpos, ypos),
wxSize(width, height)
)
{
}
BasicFrame::~BasicFrame()
{
}

//The headers I've added.
//BASIC.H

#include <wx/wx.h>
#include "basic.h"
IMPLEMENT_APP(BasicApplication)
bool BasicApplication::OnInit()
{
 BasicFrame *frame = new BasicFrame("Basic", 50, 50, 450, 300);
 frame->Show(TRUE);
 SetTopWindow(frame);
 return TRUE;
}
BasicFrame::BasicFrame
(const wxChar *title,
int xpos, int ypos,
int width, int height)
: wxFrame
( (wxFrame *) NULL,
-1,
title,
wxPoint(xpos, ypos),
wxSize(width, height)
)
{
}

//Headers addded by code:blocks
//PLATFORM.H

//Header added by code:blocks
//wx_pch.h


//Also include by code:blocks is chkconf.h

//Resource file I have addded.
//basic_resource.rc

#include "wx/msw/wx.rc"

//ERRORS I get when compiling this program.

C:\wxWidgets-2.6.2\include\wx\platform.h:190: wx/setup.h: No such file or directory
C:\wxWidgets-2.6.2\include\wx\chkconf.h:84: #error "wxUSE_DYNLIB_CLASS must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:92: #error "wxUSE_EXCEPTIONS must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:100: #error "wxUSE_FILESYSTEM must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:113: #error "wxUSE_DYNAMIC_LOADER must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:121: #error "wxUSE_LOG must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:129: #error "wxUSE_LONGLONG must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:137: #error "wxUSE_MIMETYPE must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:153: #error "wxUSE_PROTOCOL must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:195: #error "wxUSE_REGEX must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:203: #error "wxUSE_STDPATHS must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:211: #error "wxUSE_XML must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:219: #error "wxUSE_SOCKETS must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:227: #error "wxUSE_STREAMS must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:235: #error "wxUSE_STOPWATCH must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:243: #error "wxUSE_TEXTBUFFER must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:251: #error "wxUSE_TEXTFILE must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:267: #error "wxUSE_URL must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:285: #error "wxUSE_ACCEL must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:293: #error "wxUSE_BMPBUTTON must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:301: #error "wxUSE_BUTTON must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:309: #error "wxUSE_CALENDARCTRL must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:317: #error "wxUSE_CARET must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:325: #error "wxUSE_CHECKBOX must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:341: #error "wxUSE_CHOICE must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:349: #error "wxUSE_CHOICEBOOK must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:357: #error "wxUSE_CHOICEDLG must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:365: #error "wxUSE_CLIPBOARD must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:373: #error "wxUSE_COLOURDLG must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:381: #error "wxUSE_COMBOBOX must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:389: #error "wxUSE_DATAOBJ must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:397: #error "wxUSE_DATEPICKCTRL must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:405: #error "wxUSE_DISPLAY must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:413: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:421: #error "wxUSE_FILEDLG must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:429: #error "wxUSE_FONTDLG must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:437: #error "wxUSE_FONTMAP must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:445: #error "wxUSE_GAUGE must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:453: #error "wxUSE_GRID must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:461: #error "wxUSE_HELP must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:469: #error "wxUSE_HTML must be defined."
clude\wx\chkconf.h:477: #error "wxUSE_XRC must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:498: #error "wxUSE_ICO_CUR must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:506: #error "wxUSE_IFF must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:514: #error "wxUSE_IMAGLIST must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:522: #error "wxUSE_JOYSTICK must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:530: #error "wxUSE_LISTBOOK must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:538: #error "wxUSE_LISTBOX must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:546: #error "wxUSE_LISTCTRL must be defined."
C:\wxWidgets-2.6.2\include\wx\chkconf.h:554: #error "wxUSE_LOGGUI must be defined."


//My entries in global variable editor.

variable: wx
base directory: C:\wxWidgets-2.6.2\
include: empty
lib: C:\wxWidgets-2.6.2\lib\gcc_dll\mswu\wx (setup.h is here)

//My entries in global compiler setting -> directories
 
c:\wxwidgets-2.6.2\include
C:\wxWidgets-2.6.2\lib\gcc_dll\mswu\wx

Thank you anyone who has taken the time to read this post and I really appreciate it. Without someones help I feel I will soon give up.

Regards and thanks,

David.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version