News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Modified & Improved wxWidgets Project Wizard

Started by Biplab, December 23, 2006, 08:11:48 PM

Previous topic - Next topic

manutd

I'd just like to thank you for providing this wizard  :) Keep up the good work!

ascxaxsvcbsxbbqvcxqsbcvxs

I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

ascxaxsvcbsxbbqvcxqsbcvxs

BTW, there is NO space in CB directory, nor in project directory, nor in wxWidgets directory.

Biplab

Quote from: ascxaxsvcbsxbbqvcxqsbcvxs on February 02, 2007, 02:38:14 PM
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

Did you compile wxWidgets?? You have downloaded the source of wxWidgets which needs to be compiled. It seems that compiler can't find setup.h.

Also post more details.
Be a part of the solution, not a part of the problem.

Biplab

An update has been committed in Revision 3565.

Changes:

  • PCH Support for GCC was inadvertently disabled since Rev 7 of new wizard. This bug has been fixed.
  • Option has been provided to add custom header file for empty projects.
  • A newline has been added to the end of resource file to avoid warning messages in case of GCC

Known Issues:

  • PCH Support will not work for Empty projects created for GCC.
Be a part of the solution, not a part of the problem.

marlo_nl

Biplab,

Thanks for the wxWidgets Wizard.

It's extremly useful for "newbies" like me who are just getting on the learning curve of making a GPL development toolset to work.

I've been browsing the internet for about a month now before setting up a toolset consisting of the Codeblocks IDE, the MinGW compiler and the wxWidgets framework.

I took me quite some time to succesfully build a first "Hello World" wxWidgets application in CodeBlocks and in the end I managed with the help of the Rev5 wizard.

As a "newbie" I would like to know if it would be possible to modify your wizard to allow different wxWidgets library types to be used for Debug and Release Builds.

If I'm correct the wizard currently will use the same library type (either Shared or Static) for both the Release Build and the Debug build.

My question is the following:
Would it be possible to extend the wizard such that the user can select different project options (Use wxWidgets DLL, wxWidgets is built as a monolithic library and Enable unicode) for Release Builds and for Debug Builds?

Regards, Marlo

Biplab

#96
Thanks for your feedback.

Quote from: marlo_nl on February 04, 2007, 07:24:43 PM
If I'm correct the wizard currently will use the same library type (either Shared or Static) for both the Release Build and the Debug build.

My question is the following:
Would it be possible to extend the wizard such that the user can select different project options (Use wxWidgets DLL, wxWidgets is built as a monolithic library and Enable unicode) for Release Builds and for Debug Builds?

You are correct. It uses same type of libraries (shared or static) for both release and debug target.

It is somewhat difficult. Because the way script system works it may not be possible easily. I'll keep your request in mind but honestly I can't promise you.  :)

For the time being you can use alternate method. Use workspace.

  • First create one wx project with one lib config, le's say static-unicode-non-monolithic. Keep this project open.
  • Create second wx project with another lib config, let's say dll-unicode-monolithic. You've to create it in a different folder.
  • Now remove generated source (if you've ur own source) and add same source to both the projects.
  • Now save the workspace from File > Save workspace menu. From next time onwards, open the workspace and code::blocks will load both the projects.

You can uncheck the appropriate target for appropriate projects. E.g., if you wish that the first project will be built in debug mode then uncheck release target during project creation.

I agree that my suggestion may not be the best one, but it should work.  :D

Regards,

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

marlo_nl

Biplab,

Thanks for your quick reply.

For a newbie like me Squirrel and scripting Codeblocks is new as well  :)
Therefore I have no feel for what the impact of my request would be. But from your reply I understand that it's not straightforward.

Forgot to mention that I did manage to set up a project where Release Target and Build Target use different library types.
The project uses a shared library for the Debug Target and a static library for the Release Target.

The project was created the wxWidgets wizard with the "Use wxWidgets DLL" check box checked.
I changed the following "Project build options" manually:
a) In the Compiler tab moved #define WXUSINGDLL from "Project" (settings used for both Debug and Release Target) to "Debug"
b) Release Target - Linker tab
   added  Link libraries: libwxmsw28u.a, comctl32, gdi32, ole32, oleaut32 and uuid
c) Release Target - Directories tab
   Compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu
   Linker tab:   change  <path>\wxWidgets-2.8.0\lib\gcc_dll to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib
   Resource compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                             <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu

With these changes the Debug Target and the Release Target build succesfully.


I'll also check your suggestion to see which "trick" is easiest to use.



A short remark for other newbies who might think "why would you like different library types in the first place?"

For Release Targets I prefer to have an executable that doesn't depend on DLL files, hence the static library.
For the Debug Target I could use a static wxWidgets debug library. But the static wxWidgets library has a big disadvantage (when compiled with MinGW GCC) if you are short on HDD space: it is huge, about 360 MByte. The shared wxWidgets library "only consumes" about 75 MByte.


Regards, Marlo

saddam le pion

#98
Quote from: Biplab on February 02, 2007, 03:03:50 PM
Quote from: ascxaxsvcbsxbbqvcxqsbcvxs on February 02, 2007, 02:38:14 PM
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

Did you compile wxWidgets?? You have downloaded the source of wxWidgets which needs to be compiled. It seems that compiler can't find setup.h.

Isn't CB able to compile a program AND its librairies?

TDragon

Quote from: saddam le pion on February 04, 2007, 10:01:19 PM
Isn't CB able to compile a program AND its librairies?
Technically speaking, C::B isn't able to compile anything. (GCC, or whatever other compiler you choose, does the footwork.) That said, large libraries generally come with their own specific method of compilation, and wxWidgets is no exception to this rule. The C::B wiki contains straightforward instructions on how to compile wxWidgets.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Biplab

Quote from: marlo_nl on February 04, 2007, 09:55:58 PM
Forgot to mention that I did manage to set up a project where Release Target and Build Target use different library types.
The project uses a shared library for the Debug Target and a static library for the Release Target.

The project was created the wxWidgets wizard with the "Use wxWidgets DLL" check box checked.
I changed the following "Project build options" manually:
a) In the Compiler tab moved #define WXUSINGDLL from "Project" (settings used for both Debug and Release Target) to "Debug"
b) Release Target - Linker tab
   added  Link libraries: libwxmsw28u.a, comctl32, gdi32, ole32, oleaut32 and uuid
c) Release Target - Directories tab
   Compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu
   Linker tab:   change  <path>\wxWidgets-2.8.0\lib\gcc_dll to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib
   Resource compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                             <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu

With these changes the Debug Target and the Release Target build succesfully.

I'll also check your suggestion to see which "trick" is easiest to use.

That's great.  :D I gave you alternate suggestion so that you do not need to add them manually. Please post your feedback after testing the workspace feature.

Quote from: marlo_nl on February 04, 2007, 09:55:58 PM
A short remark for other newbies who might think "why would you like different library types in the first place?"

For Release Targets I prefer to have an executable that doesn't depend on DLL files, hence the static library.
For the Debug Target I could use a static wxWidgets debug library. But the static wxWidgets library has a big disadvantage (when compiled with MinGW GCC) if you are short on HDD space: it is huge, about 360 MByte. The shared wxWidgets library "only consumes" about 75 MByte.

I realised your problem and that's why I didn't ask you that question. ;) I follow similar principle for my project. While developing I use DLL for quick compilation and while distributing exe I recompile it with static wx lib and with gcc.

In my 2 PCs wxWidgets libs take almost 4 GB+ of space. Majority of these libs are used to test this wizard for any issues in Linux and Windows with different configurations. Fortunately the space is not problem for me. ;)

Quote from: saddam le pion on February 04, 2007, 10:01:19 PM
Isn't CB able to compile a program AND its librairies?

If you don't want to compile wxWidgets on your own, then download wxPack.
Be a part of the solution, not a part of the problem.

ascxaxsvcbsxbbqvcxqsbcvxs

Quote from: Biplab on February 05, 2007, 03:54:11 AM
If you don't want to compile wxWidgets on your own, then download wxPack.

thanks, i will try.

ascxaxsvcbsxbbqvcxqsbcvxs

Quote from: Biplab on February 02, 2007, 03:03:50 PM
Quote from: ascxaxsvcbsxbbqvcxqsbcvxs on February 02, 2007, 02:38:14 PM
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

Did you compile wxWidgets?? You have downloaded the source of wxWidgets which needs to be compiled. It seems that compiler can't find setup.h.

Also post more details.

I finally managed to compile wxWidgets OK (no errors, no warnings) with mingw on XP.

In the config.gcc there is the line
BUILD = debug

so in you wizard i checked "Debug". But i got the message "A matching Debug configuration cannot be found in the wxWidgets directory you specified."

I'am confused.

Biplab

Wizard checks with the combination of options you've selected. The major parameters are Static/Dynamic-Ansi/Unicode-Non-monolithic/Monolithic. So BUILD=debug ensures a debug lib but it also depends upon three more variables namely SHARED=0/1 UNICODE=0/1 and MONOLITHIC=0/1. Check the values of these variables in the makefile and then select appropriate options. Wizard will not generate that warning.
Be a part of the solution, not a part of the problem.

ascxaxsvcbsxbbqvcxqsbcvxs

OK, thanks, it worked.
You should group these 4 major parameters in the same panel, and make this obvious. For example, gray the options that do not correspond to the compiled wxWidgets, if not too complex to do.