User forums > Using Code::Blocks

wx project compile/link - behind the scenes activity

<< < (2/2)

stahta01:
I think that this is NOT normal.


--- Code: ---me@Kubuntu-1404:~$ which wx-config
/opt/wx/3.0_unicode_monolithic_shared/bin/wx-config

--- End code ---

What I get

--- Code: ---stahta01@debian:~$  which wx-config
/usr/bin/wx-config

--- End code ---


--- Code: ---stahta01@debian:~$ update-alternatives --config wx-config
There are 4 choices for the alternative wx-config (providing /usr/bin/wx-config).

  Selection    Path                                                          Priority   Status
------------------------------------------------------------
  0            /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0           308       auto mode
  1            /usr/lib/x86_64-linux-gnu/wx/config/base-unicode-3.0           307       manual mode
  2            /usr/lib/x86_64-linux-gnu/wx/config/base-unicode-release-2.8   287       manual mode
  3            /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0           308       manual mode
* 4            /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-release-2.8   288       manual mode

Press enter to keep the current choice[*], or type selection number:

--- End code ---

Tim S.

sorinev:
Turns out it was a difference in my local ~/.profile. Back in November I had downloaded the wxWidgets 3.0.2 source and compiled it myself. I hadn't known about update-alternatives back then, so I wasn't sure how to use 2.x to compile CodeBlocks from svn updates, but 3.0 to compile my personal projects. So I added the directory that my self compiled wxWidgets installed to (prefix=) to the beginning of the path in my own ~/.profile file and made a couple of scripts to switch a symlink back and forth between 2.8 and 3.0 as necessary.

So whatever specific wxWidgets configuration (from /usr/bin) CodeBlocks was pointing to had some differences, which included AUI by default in --libs. (Another difference was a global compiler setting in CodeBlocks for std-c11).

Anyhow, the build output, binary sizes, and GUI elements are exactly the same now.


Not a CodeBlocks problem, sorry!

cacb:
I have had very similar problems in the past, I think it is a source of potential trouble that wx-config relies on path settings etc. I also build wx3.0 myself (to static libraries) but need to build C::B against wx in the Kubuntu repository

Therefore, I rolled my own C::B project setup with the following

under compiler settings/other options
`$(#wx.config) --cxxflags`

and under linker settings/other linker options
`$(#wx.config) --libs std,aui --static`

my wx global variable in C::B points to /usr/local (base) and it has a user-defined field "config" which is set to
/usr/local/bin/wx-config  --version=3.0  --toolkit=gtk2

This way I am always sure I get the right selection.

For some time I needed to build against both wx2.8 and wx3.0, and I managed to do it for many similar projects by changing the definition of the wx global variable only.

Navigation

[0] Message Index

[*] Previous page

Go to full version