Author Topic: Setting Code::Blocks  (Read 5621 times)

Offline gandalf

  • Single posting newcomer
  • *
  • Posts: 2
Setting Code::Blocks
« on: February 06, 2013, 09:14:32 am »
Hi all
I used a little code :: blocks on linux without any problems (I'm a beginner).
Now I am trying to use it on Windows 7 and I have some problems and doubts that I can't fix due to lack of experience.

1) it is better to use code :: blocks with mingw that comes with the installation package or is it better to use Mingw-get-inst to install the compiler (http://sourceforge.net/projects/mingw/?source=navbar)

2) I installed wxPack_v2.8.12.01 for WX precompiled.
With Code::Blocks 10.5 I can compile programs that use WX and it all works.
But if I use Code::Blocks 12.11 and wxPack_v2.8.12.01 the application should crash.
It would be better to use a version of WX compiled manually on my machine?

3) exist a tutorial to set up Code::Blocks for using FLTK and wxWidgets?

Thank you all for your attention

Offline gandalf

  • Single posting newcomer
  • *
  • Posts: 2
Re: Setting Code::Blocks
« Reply #1 on: February 06, 2013, 05:30:10 pm »
First step executed.

I decided to use Mingw-get-inst to install the compiler.
Then I unpacked the sources for wxWidgets 2.8.12 in the home folder of mingw which for me is:
C:\MinGW\msys\1.0\home\francesco

Then I started the shell (bash) which is installed by mingw and from this I have compiled wxWidgets with the following commands:
Code
mingw32-make.exe-f makefile.gcc clean
mingw32-make.exe-f makefile.gcc USE_XRC = 1 SHARED = 1 MONOLITHIC = 1 BUILD = release UNICODE = 0
mingw32-make.exe-f makefile.gcc USE_XRC = 1 SHARED = 1 MONOLITHIC = 1 BUILD = debug UNICODE = 0


At this point, I copied the WX folder on the root of my hard drive ( C: ).

I installed code :: blocks without Mingw (which I previously installed) and I created a project Wx but at this point I get the following errors:

Quote
1
A matching Debug configuration can not be found in the wxWidgets directory you specified.
This Menas That Debug target of your project will not build.


Quote
2
A matching Release configuration can not be found in the wxWidgets directory you specified.
This Menas That Release target of your project will not build.

How do I fix this?
I forgot something, I have to add the path of the Wx folder (on the root of C:) to the system path ?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Setting Code::Blocks
« Reply #2 on: February 21, 2013, 04:00:45 pm »
Hi all
I used a little code :: blocks on linux without any problems (I'm a beginner).
Now I am trying to use it on Windows 7 and I have some problems and doubts that I can't fix due to lack of experience.

1) it is better to use code :: blocks with mingw that comes with the installation package or is it better to use Mingw-get-inst to install the compiler (http://sourceforge.net/projects/mingw/?source=navbar)

2) I installed wxPack_v2.8.12.01 for WX precompiled.
With Code::Blocks 10.5 I can compile programs that use WX and it all works.
But if I use Code::Blocks 12.11 and wxPack_v2.8.12.01 the application should crash.
It would be better to use a version of WX compiled manually on my machine?
See http://wxpack.sourceforge.net/Main/HomePage, the wxPack2.8.12 was built with tdm-gcc-4.4.1-dw2.
Remember you should always use the SAME compiler to build wxWidgets library and your application. Otherwise, you will get crash.

Quote
3) exist a tutorial to set up Code::Blocks for using FLTK and wxWidgets?
Thank you all for your attention
I know nothing about FLTK.




First step executed.

I decided to use Mingw-get-inst to install the compiler.
Then I unpacked the sources for wxWidgets 2.8.12 in the home folder of mingw which for me is:
C:\MinGW\msys\1.0\home\francesco

Then I started the shell (bash) which is installed by mingw and from this I have compiled wxWidgets with the following commands:
Code
mingw32-make.exe-f makefile.gcc clean
mingw32-make.exe-f makefile.gcc USE_XRC = 1 SHARED = 1 MONOLITHIC = 1 BUILD = release UNICODE = 0
mingw32-make.exe-f makefile.gcc USE_XRC = 1 SHARED = 1 MONOLITHIC = 1 BUILD = debug UNICODE = 0


At this point, I copied the WX folder on the root of my hard drive ( C: ).

You don't need bash to build wx library, just Windows command line is enough run the above command.

Quote
I installed code :: blocks without Mingw (which I previously installed) and I created a project Wx but at this point I get the following errors:

Quote
1
A matching Debug configuration can not be found in the wxWidgets directory you specified.
This Menas That Debug target of your project will not build.


Quote
2
A matching Release configuration can not be found in the wxWidgets directory you specified.
This Menas That Release target of your project will not build.

How do I fix this?
I forgot something, I have to add the path of the Wx folder (on the root of C:) to the system path ?

Did you set the global variables, they are Menu->Settings->global variables. You need to set the variable named wx.
See:WxWindowsQuickRef - CodeBlocks
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.