Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: momaa on February 04, 2007, 02:37:25 pm

Title: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: momaa on February 04, 2007, 02:37:25 pm
Hello,

System: Ubuntu Feisty HERD 3 (test 3 of the upcoming Ubuntu 7.04, to released in April 2007)
Code::Blocks IDE: svn build rev 3566,  feb 4.

I created a simple wxWidgets 2.6 project using the wizard.
When I compile the project, it says that: "No config found to match: wx-config  --version=2.6 --static=yes --unicode=no --debug=yes --cflags"

If I type the wx-config command on the command line, it reveals that some of the --flags are unknown.

$ wx-config  --version=2.6 --static=yes --unicode=no --debug=yes --cflags

  Warning: No config found to match: /usr/bin/wx-config --version=2.6 --static=yes --unicode=no --debug=yes --cflags
           in /usr/lib/wx/config
  If you require this configuration, please install the desired
  library build.  If this is part of an automated configuration
  test and no other errors occur, you may safely ignore it.
  You may use wx-config --list to see all configs available in
  the default prefix.
----------------

Wx-config does not know about these options:
 --static=yes --unicode=no --debug=yes 

But it accepts these arguments:
 --static=no  --unicode=yes  --debug=no
----------------

Wx-config's help page reports this:
$ wx-config  --help

 wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--release] [--version-full]
           [--list] [--host=HOST] [--toolkit=TOOLKIT] [--universal[=yes|no]]
           [--unicode[=yes|no]] [--debug[=yes|no]] [--static[=yes|no]]
           [--version[=VERSION]] [--basename] [--cc] [--cppflags] [--cflags]
           [--cxxflags] [--rezflags] [--libs] [--cxx] [--ld] [--linkdeps]
           [--utility=UTIL] [LIB ...]
----------------

This Ubuntu installment has these package versions:

$ wx-config --version
2.6.3

$ apt-cache show libwxbase2.6-0
Version: 2.6.3.2.1.5ubuntu4
Replaces: libwxgtk2.6-0 (<< 2.6.3.2)
Depends: libc6 (>= 2.5-0ubuntu1), libexpat1 (>= 1.95.8), libgcc1 (>= 1:4.1.1-21ubuntu1), libstdc++6 (>= 4.1.1-21ubuntu1), zlib1g (>= 1:1.2.1)
Filename: pool/universe/w/wxwidgets2.6/libwxbase2.6-0_2.6.3.2.1.5ubuntu4_i386.deb

$ apt-cache show libwxgtk2.6-dev
Original-Maintainer: Ron Lee <ron --at-- debian.org>
Architecture: i386
Source: wxwidgets2.6
Version: 2.6.3.2.1.5ubuntu4
Depends: wx2.6-headers (= 2.6.3.2.1.5ubuntu4), libwxgtk2.6-0 (= 2.6.3.2.1.5ubuntu4), libwxbase2.6-dev (= 2.6.3.2.1.5ubuntu4), libc6-dev
Filename: pool/universe/w/wxwidgets2.6/libwxgtk2.6-dev_2.6.3.2.1.5ubuntu4_i386.debAttaxhed a screenshot.

A screenshot: http://www.futuredesktop.org/tmp/Screenshot-1.png

Of course, the project compiles succesfully if I remove the bad --arguments.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: stahta01 on February 04, 2007, 02:43:32 pm
Hello,

System: Ubuntu Feisty HERD 3 (test 3 of the upcoming Ubuntu 7.04, to released in April 2007)
Code::Blocks IDE: svn build rev 3566,  feb 4.

I created a simple wxWidgets 2.6 project using the wizard.
When I compile the project, it says that: "No config found to match: wx-config  --version=2.6 --static=yes --unicode=no --debug=yes --cflags"

If I type the wx-config command on the command line, it reveals that some of the --flags are unknown.

$ wx-config  --version=2.6 --static=yes --unicode=no --debug=yes --cflags

  Warning: No config found to match: /usr/bin/wx-config --version=2.6 --static=yes --unicode=no --debug=yes --cflags
           in /usr/lib/wx/config
  If you require this configuration, please install the desired
  library build.  If this is part of an automated configuration
  test and no other errors occur, you may safely ignore it.
  You may use wx-config --list to see all configs available in
  the default prefix.

IMHO, It is saying that it can NOT find a compiled version on wxWidgets that matches what you are requesting.

Do you have wxWidgets 2.6 compiled on your machine with static=yes --unicode=no --debug=yes ?

If you do, it might need to be told where to find it, using --prefix.

Tim S
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 04, 2007, 03:59:36 pm
The wizard requests you to select appropriate version of wx lib. Wizard does not check existence of required wx configuration in Linux. Thus always select the appropriate version or you'll face such errors.

To check which configuration(s) you have type wx-config --list in the shell. It will give you list of available configurations. Based in that output select the appropriate options in wizard.  :)
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: momaa on February 04, 2007, 06:43:29 pm
Ok. Thanks for the explanation.
This Ubuntu machine has a default wxWidgets installation.

$ wx-config --list

 Default config is gtk2-unicode-release-2.6

  Default config will be used for output

   Alternate matches:
      base-unicode-release-2.6

It is impossible to create a wxWidgets 2.6 project (using the wizard) that compiles without manual tuning.
Newbies will not be happy.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: stahta01 on February 04, 2007, 06:46:05 pm
This Ubuntu machine has a default wxWidgets installation.

$ wx-config --list

 Default config is gtk2-unicode-release-2.6

  Default config will be used for output

   Alternate matches:
      base-unicode-release-2.6

It is impossible to create a wxWidgets 2.6 project (using the wizard) that compiles without manual tuning.
Newbies will not be happy.

So what the Newbies are never happy in my view because they think that they should NOT have to do any work to learn how to code.

Tim S
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: momaa on February 04, 2007, 07:09:13 pm
Do not be silly.
A newbie should be able to create a minimum app using the wizard -- just by clicking the Next> button.
Luckily Linux has other IDEs that fulfill this requirement.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 04, 2007, 07:14:49 pm
Ok. Thanks for the explanation.
This Ubuntu machine has a default wxWidgets installation.

$ wx-config --list

 Default config is gtk2-unicode-release-2.6

  Default config will be used for output

   Alternate matches:
      base-unicode-release-2.6

It is impossible to create a wxWidgets 2.6 project (using the wizard) that compiles without manual tuning.
Newbies will not be happy.

It's very difficult to satisfy everyone. I've tried to modify it in such a way so that it can satisfy most of the people but NOT each and everyone. You have started with installing wxBase which fewer developers use.

It's possible to add another page asking user to specify the toolkits that they are using, host, prefix, exec-prefix, etc. These jargons will be utterly confusing to most of the newbies contrary to your belief.

The Linux wizard is simple. It doesn't do a lot of things which Windows part do. But to be honest before I commit some advanced features, I need better understanding of wx, Linux and most importantly C::B sdk.  :)
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 04, 2007, 07:27:30 pm
Do not be silly.
A newbie should be able to create a minimum app using the wizard -- just be clicking the Next> button.
Luckily Linux has other IDEs that fulfill that requirement.

FYI wxWidgets comes with different lib configurations (10-15+). How can we come to know that all users are using a particular configuration??  :o

The wizard is provided to help user configure their project for a particular lib config. But if you use it blindly it's not C::B's fault. Wizard warns you that you have to select an appropriate lib config or otherwise it will fail to compile.

If other IDEs allow you to click Next button to generate a project, then possibly you are locked to a particular configuration. It's good to start but bad to understand the beauty of other configs.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: momaa on February 05, 2007, 02:26:44 pm
Could we have 2 selections in the wxWidgets' wizard.

o....Create a basic wxWidgets application.

o.....Create wxWidgets application with advanced options (expert mode).
---------------------------

The first option will simply create a functional basic form with minimum wx-config arguments.  The second option will ask the user what features (wx-config options) to include and compile with.

Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: stahta01 on February 05, 2007, 04:34:24 pm
FYI:

In case you did not know a port of wx-config exists for windows. http://code.google.com/p/wx-config-win/
Sorry if it was already mentioned, I have not read the whole thread.

Tim S

Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Pecan on February 06, 2007, 05:23:36 am
Could we have 2 selections in the wxWidgets' wizard.

o....Create a basic wxWidgets application.

o.....Create wxWidgets application with advanced options (expert mode).
---------------------------

The first option will simply create a functional basic form with minimum wx-config arguments.  The second option will ask the user what features (wx-config options) to include and compile with.



I also vote for a simple basic `wx-config --cflags` and `wx-config --libs`

On Linux it took me about 20 minutes to figure out why my simple test pgm was getting all those debug and wierd errors I'd never seen before.

I had to remove the wizard and replace it with an older version to figure out where the problems were.

I don't think a wizard should be causing more problems, as opposed to being a help. Introducing all these features should serve the users better on an advanced page I think.


Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 06:47:20 am
Ok. I'll rearrange the page. Please wait for the update.

On Linux it took me about 20 minutes to figure out why my simple test pgm was getting all those debug and wierd errors I'd never seen before.
If user installs wx-libs in Linux then they should be knowing the configurations.

I don't think a wizard should be causing more problems, as opposed to being a help. Introducing all these features should serve the users better on an advanced page I think.

NO, Wizard's intention is not to create more problems. Rather it's intention is to help users. Honestly speaking please don't blame the wizard because you are unaware of the wx-lib configuration that your system have.

I also vote for a simple basic `wx-config --cflags` and `wx-config --libs`

wx-config --cflags will use the default configuration. What is your opinion on Debug and Release Target? Means do you think it would be appropriate to add same command both in Debug and Release Target?

Regards,

Biplab
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: mandrav on February 06, 2007, 08:55:33 am
Biplab, the only way you could satisfy everyone would be to add a single checkbox labeled "Use default wxWidgets settings" which, if checked, would use `wx-config --cflags` and `wx-config --libs` for both targets. Then newbies wouldn't get confused and more advanced users would use the other options.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 09:05:52 am
Biplab, the only way you could satisfy everyone would be to add a single checkbox labeled "Use default wxWidgets settings" which, if checked, would use `wx-config --cflags` and `wx-config --libs` for both targets. Then newbies wouldn't get confused and more advanced users would use the other options.

Thanks for the suggestion.  :D

I have already regrouped it, but I've kept it in a single page. Is there any way to disable/enable a part of wizard page dynamically (means as soon as an user selects an option)?

If it's not possible, then I'll split it into two pages.  :)
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: mandrav on February 06, 2007, 09:29:10 am
Quote
Is there any way to disable/enable a part of wizard page dynamically (means as soon as an user selects an option)?

Hehe, as a matter of fact it aready is possible ;).

When clicking any button/checkbox/combobox/choice/listbox/radiobox in your XRC page, the script function OnClick_<control_name> is called. In there, you can use Wizard.EnableWindow(_T("control_name"), true/false) to enable/disable any control on the page.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 09:39:20 am
Quote
Is there any way to disable/enable a part of wizard page dynamically (means as soon as an user selects an option)?

Hehe, as a matter of fact it aready is possible ;).

When clicking any button/checkbox/combobox/choice/listbox/radiobox in your XRC page, the script function OnClick_<control_name> is called. In there, you can use Wizard.EnableWindow(_T("control_name"), true/false) to enable/disable any control on the page.

Thanks a lot mandrav. Now I can add some sort of interactivity.

I read about these changes, but didn't track how it is done. Thanks again for the suggestion.  :D
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: mandrav on February 06, 2007, 09:49:27 am
You should also know that you can "detect" what wx configurations are installed by using IO.ExecuteAndGetOutput("wx-config --list") and parsing the results ;).
Note though that this will trigger a security dialog so make sure you prepare the user for it.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 09:54:04 am
You should also know that you can "detect" what wx configurations are installed by using IO.ExecuteAndGetOutput("wx-config --list") and parsing the results ;).
Note though that this will trigger a security dialog so make sure you prepare the user for it.

Hmm.. It seems I'm using dated knowledge. I'll refresh my knowhow and try to use newer and better functions in the script.  :)

But how many possible configurations are available in Linux? E.g., gtk2-*, gtk-*, x11-*, and others??
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: mandrav on February 06, 2007, 10:13:56 am
Quote
But how many possible configurations are available in Linux? E.g., gtk2-*, gtk-*, x11-*, and others??

You should not care about that at all. If you go the "detection" route, you will just present the found configurations and let the user choose which one to use.
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 10:19:59 am
Ok. I'll implement it later this week.

The changes are made. I would test it before I commit. Screenshot is attached below.

(http://img2.freeimagehosting.net/uploads/efcea6333f.png)
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 10:52:22 am
Tested and Committed. In Revision 3574.

The Advanced options shall be unavailable if user selects "Use default wxWidgets settings".

Thanks to momaa, Pecan and Mandrav.  :)
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Pecan on February 06, 2007, 02:42:21 pm
Tested and Committed. In Revision 3574.

The Advanced options shall be unavailable if user selects "Use default wxWidgets settings".

Thanks to momaa, Pecan and Mandrav.  :)

Biplab, thanks for that. And I *do* appreciate all your hard work.

When debugging CB for hours, or figuring out how some code works, it's important to me to just whip up a simple test case fast and easy.

Spending 20 minutes figuring out why a simple test case won't work makes us old guys forget why we were doing it in the first place.

I have a number of wxWidget configurations on my machine, and I don't want to have to remember the particulars of which one I last set each time I create a test program. The simple wx-config --cflags and --libs will set them for me. Then I can get back to debugging or stepping through the code.

thanks again
pecan
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 02:57:09 pm
Biplab, thanks for that. And I *do* appreciate all your hard work.

When debugging CB for hours, or figuring out how some code works, it's important to me to just whip up a simple test case fast and easy.

Spending 20 minutes figuring out why a simple test case won't work makes us old guys forget why we were doing it in the first place.

I have a number of wxWidget configurations on my machine, and I don't want to have to remember the particulars of which one I last set each time I create a test program. The simple wx-config --cflags and --libs will set them for me. Then I can get back to debugging or stepping through the code.

thanks again
pecan

Pecan,

I highly regard you and other senior dev's effort to make it one of the most powerful IDE.  :D

Before it was committed in the repository, I requested users to test it and post their valuable feedbacks and suggestions. I've tried to implement most of the suggestions I've received, just like this one.

Hope the newer modification will be helpful. Kindly post any other suggestions that you have.  :)

Regards,

Biplab
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 03:53:41 pm
@Mandrav, I was trying to use IO.ExecuteAndGetOutput(_T("`wx-config --list`")); But it is returning a NULL string.

I was getting the security warning and I allowed the script to run. But still no result. I have run C::B in SU mode and in normal user mode. But the result is same. What could be the problem??

Regards,

Biplab
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: mandrav on February 06, 2007, 05:45:20 pm
@Mandrav, I was trying to use IO.ExecuteAndGetOutput(_T("`wx-config --list`")); But it is returning a NULL string.

I was getting the security warning and I allowed the script to run. But still no result. I have run C::B in SU mode and in normal user mode. But the result is same. What could be the problem??

Regards,

Biplab

IO.ExecuteAndGetOutput() does not return a string but rather a wxArrayString (IIRC)...
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 06, 2007, 05:53:27 pm
Oh.. Then the Wiki should be changed.

I'll try tomorrow afternoon and will post you result.  :)


Edit 1:
It returns a wxString. But there might be bug in the last line of following code (I'm not absolutely sure).

File: src/sdk/scripting/bindings/sc_io.cpp
Code
wxString ExecuteAndGetOutput(const wxString& command)
        {
            .... ......
            wxExecute(command, output, wxEXEC_NODISABLE);
            return GetStringFromArray(output);
        }

GetStringFromArray requires 2 parameters whereas only 1 has been supplied.  :)
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: mandrav on February 06, 2007, 06:56:50 pm
Quote
It returns a wxString. But there might be bug in the last line of following code (I'm not absolutely sure).

Oh, sorry, seems I didn't remember well.
Anyway, the 2nd param of GetStringFromArray() is the delimiter to use, which defaults to ";" (IIRC).
I 'm going to have a look...
Title: Re: wxWidgets project in Ubuntu Linux: wx-config error. Unknown flags.
Post by: Biplab on February 11, 2007, 06:30:52 pm
The function works now. (Found in Rev 3579)

Thanks for the fix.  :D