Author Topic: Newbie problem in setting up wxwidgets and Codeblocks.  (Read 22589 times)

chiamko

  • Guest
Newbie problem in setting up wxwidgets and Codeblocks.
« on: March 07, 2007, 05:30:42 pm »
Hi All:

Apologies if this sounds too basic as I am really at a lost of what to do. I would like to do some programming with wxWidgets using Codeblocks as the IDE. I have downloaded CodeBlocks with MINGW complier V1.0 rc2. I have also downloaded WxMSW for wxWidgets2.8.0

From what I gathered from the Forum, I have also downloaded the nightly builts released on 2 March 2007 Rev3659. I am able to start Codeblocks by unzipping the nightly builts.

I then proceed to complie the wxWidgets library as instructed by
    "http://www.wxwidgets.org/wiki/index.php/CodeBlocks_Setup_Guide"
After the compilation, a new directory was created under my wxwidgets directory like this
    "<WXWIDGETS DIRECTORY>\lib\gcc_dll"

I did not amend any settings so far and I proceed to create a new wxWidgets project using the template available in Codeblocks. I am confuse at this point as the following few dialogs required checking/unchecking of some options which I am clueless about. One of the dialogs required the setting of wxWidgets library of which there are 3 options :

1. Use wxWidgets Dll
2. wxWidgets is built as a monolithic library
3. Enable Unicode

The next section required the setting for
1. Create empty project
2. Create and use precomplied header (PCH)
3. Configure advanced options

I am not sure which of the settings should be checked/unchecked.

At this point, when I clicked "next", a dialog will pop out to prompt me that
     "A matching debug configuration cannot be found in the wxwidgets directory you specified ....."
I opt to ignore and just proceed. When I tried to build the project, the compilation was ok but the linking will have the following error
    "Debug ===ld.exe:: cannot find -lwxmsw28d_core:: === Build finished: 1 errors, 0 warnings ==="

I am sorry if this is too confusing but basically I just would like to get started to code in wxwidgets using Codeblocks. As such, I really appreciate any help I can obtain here.

Thank you very much for your patience and guidance.


Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #1 on: March 07, 2007, 06:06:01 pm »
I then proceed to complie the wxWidgets library as instructed by
    "http://www.wxwidgets.org/wiki/index.php/CodeBlocks_Setup_Guide"
After the compilation, a new directory was created under my wxwidgets directory like this
    "<WXWIDGETS DIRECTORY>\lib\gcc_dll"

I did not amend any settings so far and I proceed to create a new wxWidgets project using the template available in Codeblocks. I am confuse at this point as the following few dialogs required checking/unchecking of some options which I am clueless about. One of the dialogs required the setting of wxWidgets library of which there are 3 options :

1. Use wxWidgets Dll
2. wxWidgets is built as a monolithic library
3. Enable Unicode

These settings are wx lib settings and are vital. They will depend upon the build of wx lib that your system have. You'll find a build.cfg file inside <WXWIDGETS DIRECTORY>\lib\gcc_dll\msw{ud} directory. Open it with Notepad and find the following values.
  • SHARED=1  Check the option, "1. Use wxWidgets Dll", else uncheck it.
  • MONOLITHIC=1  Check the option, "2. wxWidgets is built as a monolithic library", else uncheck it.
  • UNICODE=1  Check the option, "3. Enable Unicode", else uncheck it.

If you are in doubt of wx configuration, always do this small check. I hope this clears your doubt.

The next section required the setting for
1. Create empty project
2. Create and use precomplied header (PCH)
3. Configure advanced options

You can safely ignore this section. This is provided for advanced users who want to tweak their project. You'll find them handy once you are more familiar with wxWidgets. :)

At this point, when I clicked "next", a dialog will pop out to prompt me that
     "A matching debug configuration cannot be found in the wxwidgets directory you specified ....."

It's a check which tells you that your system does not have Debug libraries of wxWidgets. So you can ignore this error. For your application please change your build target to Release and then build your project and it should build successfully. :)

Don't worry, once I was also confused like you and got help from many peoples. :)

Hopefully now you would be able to compile your application. In case of any more doubt, feel free to ask questions.

Regards,

Biplab
Be a part of the solution, not a part of the problem.

chiamko

  • Guest
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #2 on: March 07, 2007, 06:51:51 pm »
Hi:

Thank you so much for your prompt reply. I have changed the build target to "release" and it works!! However, does that mean I will no longer be able to debug my application?

Thank you very much



Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #3 on: March 07, 2007, 07:01:30 pm »
You have to compile wxWidgets in debug mode. If you've compiled on your own, then use BUILD=debug flag while compiling wx.
Be a part of the solution, not a part of the problem.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #4 on: March 07, 2007, 08:33:03 pm »
You have to compile wxWidgets in debug mode.
This is not entirely accurate, as it is quite possible to build, with debug information (the -g flag), an app that uses a build of wxWidgets in non-debug mode. This is what Code::Blocks itself does, and is the reason for one of the wxWidgets wizard's advanced options -- when used, your app's debug target will use the same release build of wxWidgets that your release target does.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #5 on: March 07, 2007, 08:40:09 pm »
Thanks TDragon for pointing that. :)

I almost forgot that this is possible for GCC. ;)
Be a part of the solution, not a part of the problem.

Offline Gerry4481

  • Single posting newcomer
  • *
  • Posts: 6
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #6 on: June 23, 2013, 07:45:14 am »
Years later I had the same Problem :


I have solved my problem :-)))))) oh men it's so easy__*lol*

I make ALWAYS the same mistake!!!

SO when I create a new Project at the >>Compiler Configuration>>GNU GCC Compiler>>

there are two Options: 1. Create "Debug" Configuration
                               2. Create "Release" Configuration

here  I choose always both of this two Options :-(( but you have to choose one of the options. that depends of the build options of wxWidgets

I have build with this options: mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport

IMPORTANT IS THIS PART OF THE OPTION "BUILD=release"

so I have to choose in the new Project in Code::Blocks >>Compiler Configuration>>GNU GCC Compiler>>

only>> Create "Release" Configuration

That`s it!!!

In the end it's so simple!
 

Offline mario_mc

  • Single posting newcomer
  • *
  • Posts: 3
Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #7 on: August 03, 2013, 01:10:23 am »
I have different problem which has not found on the forums or guides.
after installing code :: block with MinGW and compile wxWidegets2.9.5 using:
SHARED=1  
MONOLITHIC=1  
UNICODE=1

but after i create new project following by instruction
everything's fine but when i run and build project it appear a error:
windres.exe: can't popen `gcc -E -xc -DRC_INVOKED -ID:\wxWidgets-2.9.5\include -ID:\wxWidgets-2.9.5\lib\gcc_dll\mswu D:MyProject\test\resource.rc': No such file or directory
I have no idea what is causes problem please help


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2616
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #8 on: August 04, 2013, 09:55:44 pm »
why such a grave desecration? Make a new thread if you have a new question, and this is a independent (new) question....

and before you write the new question read this:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

greetings

Offline Utpal_B

  • Single posting newcomer
  • *
  • Posts: 2
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #9 on: August 10, 2013, 12:36:11 pm »
You can watch this video on Youtube http://www.youtube.com/watch?v=FgAaiBg4wEE. It explains step by step compilation instructions.

griso

  • Guest
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #10 on: May 05, 2015, 10:09:16 am »
Hi Guys.
I have a little proble with CB 13.12 and WxWidgets 3.0.2.
I followed this newbie guide and everything is ok, but when I build my project I receive this error :

||=== Build: Release in test_wx_2 (compiler: GNU GCC Compiler) ===|
||warning: C:\CodeBlocks\wxWidgets: linker input file unused because linking not done|
||warning: C:\CodeBlocks\wxWidgets: linker input file unused because linking not done|
ld.exe||cannot find C:\CodeBlocks\wxWidgets: Permission denied|
||=== Build failed: 1 error(s), 2 warning(s) (0 minute(s), 7 second(s)) ===|


Where is the problem?

Thanks for help.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2616
Re: Newbie problem in setting up wxwidgets and Codeblocks.
« Reply #11 on: May 05, 2015, 10:44:33 pm »
why such a grave desecration? Make a new thread if you have a new question, and this is a independent (new) question....

and before you write the new question read this:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

greetings