Page 1 of 1

wx-config: bad path

Posted: Sat Feb 06, 2016 8:02 am
by Alexandre GESP
Hello everybody.
Please excuse me if my question is stupid.
I used wxWidgets since a long time on Window with no problems.
No I am trying to compile to Linux (xbuntu on a Arm machine).
I have download the packge of wx 2.8, installed Code::Blocks, and run the samples: Ok.
I need version 3.0.2, so I downloaded the source, compile and test the samples: Ok
BUT...
I have an error when trying to make a wxString from char (wxString("blablabla")).

Code: Select all

/home/cloudsto/dev/mplayer/mplayerMain.cpp:113:94: error: no matching function for call to 'wxString::Format(const char [43], WXWidget)'
I already have this kind of error when migrating from 2.8 to 3.0, so I looked at the path used by g++, and it's where I am confused...
This is the command used by g++:

Code: Select all

g++ -Wall -I/usr/lib/arm-linux-gnueabihf/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g  -c /home/cloudsto/dev/mplayer/mplayerMain.cpp -o obj/Debug/mplayerMain.o
Note that the includes use the old library 2.8, not 3.0 , witch explain the compiling error.
The path used by g++ come from wx-config. In Code::Block, I have 'wx-config --cflags' in compiler settings->Other options'
Now the weird thing: In console, when I ask wx-config, I tells me 3.0:

Code: Select all

cloudsto@rikomagic:~$ wx-config --cflags
-I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread
and when I ask about wx-config itself, i have many copy:

Code: Select all

cloudsto@rikomagic:~$ sudo find / -name wx-config
/usr/local/bin/wx-config
/usr/src/wxWidgets-3.0.2/wx-config
/usr/bin/wx-config
/var/lib/dpkg/alternatives/wx-config
/etc/alternatives/wx-config
This is where my ended my knowledge... I don't know WHY wx-config says 3.0 to me, and 2.8 to g++ !!!!

I guess something goes terrrribly wrong in my config...


Of course, I have solved the error by modifying the settings in Compiler options to '/usr/src/wxWidgets-3.0.2/wx-config --cflags', but it does not explain why wx-config, who purpose is to gently allow many versions of wxWidgets on the same computer in driving me nuts...

Re: wx-config: bad path

Posted: Sat Feb 06, 2016 10:07 am
by DavidHart
Hi,
Please excuse me if my question is stupid.
No, not stupid at all.
I am trying to compile to Linux (xbuntu on a Arm machine)
Which xubuntu release?

You have installed wx3.0.2 under /usr/local/, which is the default destination if you don't tell configure to put it somewhere else. The packaged wx2.8.12 is, as always, under /usr/. So which gets used depends on your $PATH, which in *buntus often doesn't include /usr/local/.

I'm slightly surprised that wx3.0.2 was found in your terminal. Had you altered that particular terminal's $PATH, or altered it globally e.g. in .bashrc? Or, to ask that question a different way: open a new terminal; what is the relevant output of echo $PATH ?

An alternative approach is to look at the Code::Blocks settings. Does Code::Blocks have a place to set the PATH that it uses, or a place to specify which wx-config? If so, is it set correctly?

Regards,

David

Re: wx-config: bad path

Posted: Sat Feb 06, 2016 11:38 am
by Alexandre GESP
Thank you for trying to help me to understand the problem.
I run Ubuntu 14.10:

Code: Select all

cloudsto@rikomagic:~$ cat /etc/*-release
DISTRIB_DESCRIPTION="Ubuntu 14.10"
VERSION="14.10 (Utopic Unicorn)"
ID_LIKE=debian
And here is my path:

Code: Select all

echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
And I have done anything unusal or modified the system paths.

Just done ldconfig after the make install

And there is nothing special in Code::block. All search path are empty, and no global variable.

Re: wx-config: bad path

Posted: Sat Feb 06, 2016 2:15 pm
by DavidHart
I don't know why it's happening, then; and I don't use C::B so I'm not the best person to help you find out. One suggestion: You could try creating a new project in C::B and see if it gets it wrong again.

If no C::B user offers better ideas, I think your choices are:
  • play with update-alternatives and make sure wx3.0.2 is the default
    use the full path to the 3.0.2 wx-config in the C::B compiler and linker settings
    ask on the C::B forum