Author Topic: linking to a specific lib version  (Read 4224 times)

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
linking to a specific lib version
« on: April 19, 2011, 06:34:40 am »
On Linux, I created a CB project using the wizard selecting "wxWidgets 2.9.x (SVN Version)"
however when I build and do a ldd on the binary it say it's linking to version 2.8 ?

$ ldd wxDebug
        linux-vdso.so.1 =>  (0x00007fff6f1ff000)
        libwx_gtk2u_richtext-2.8.so.0 => /usr/lib/libwx_gtk2u_richtext-2.8.so.0 (0x00007f709f811000)
        libwx_gtk2u_aui-2.8.so.0 => /usr/lib/libwx_gtk2u_aui-2.8.so.0 (0x00007f709f59c000)
        libwx_gtk2u_xrc-2.8.so.0 => /usr/lib/libwx_gtk2u_xrc-2.8.so.0 (0x00007f709f303000)
        libwx_gtk2u_qa-2.8.so.0 => /usr/lib/libwx_gtk2u_qa-2.8.so.0 (0x00007f709f0e1000)
        libwx_gtk2u_html-2.8.so.0 => /usr/lib/libwx_gtk2u_html-2.8.so.0 (0x00007f709ee34000)
        libwx_gtk2u_adv-2.8.so.0 => /usr/lib/libwx_gtk2u_adv-2.8.so.0 (0x00007f709eb55000)
        libwx_gtk2u_core-2.8.so.0 => /usr/lib/libwx_gtk2u_core-2.8.so.0 (0x00007f709e54f000)
        libwx_baseu_xml-2.8.so.0 => /usr/lib/libwx_baseu_xml-2.8.so.0 (0x00007f709e345000)
        libwx_baseu_net-2.8.so.0 => /usr/lib/libwx_baseu_net-2.8.so.0 (0x00007f709e116000)
        libwx_baseu-2.8.so.0 => /usr/lib/libwx_baseu-2.8.so.0 (0x00007f709ddc5000)

What do I need to correct to link against 2.9

fyi, My special build for wxWidgets 2.9 is installed under /var/local
Kind Regards,
Rajinder Yadav

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: linking to a specific lib version
« Reply #1 on: April 19, 2011, 08:38:17 am »
Where is your wx-config script installed? I have a feeling that your project settings make it so that the default wx-config script is called, and you thus end up linking to the original system installed wx version.
Under Linux, I can get as many versions of wxWidgets as I like by building them, but skipping the last step (make install), and renaming each versions' produced wx-config. For example, I use wx29-config for wxWidgets 2.9 and create a link under a path added directory. I then change all references of wx-config to wx29-config in my project settings.

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: linking to a specific lib version
« Reply #2 on: April 20, 2011, 01:45:01 am »
the new wx-config script is under /var/local/bin, so where is CB do i tell it to look there?
Kind Regards,
Rajinder Yadav

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: linking to a specific lib version
« Reply #3 on: April 20, 2011, 08:12:21 am »
the new wx-config script is under /var/local/bin, so where is CB do i tell it to look there?
...how about providing the full path name?! :shock:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: linking to a specific lib version
« Reply #4 on: April 20, 2011, 09:09:08 am »
where do i put this full path name? "/var/local/bin/wx-config" if that is what I am suppose to tell CB to use to configure my wxWidgets build??
Kind Regards,
Rajinder Yadav

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: linking to a specific lib version
« Reply #5 on: April 20, 2011, 09:17:27 am »
where do i put this full path name? "/var/local/bin/wx-config" if that is what I am suppose to tell CB to use to configure my wxWidgets build??

It should work. For example, where the project settings now say "wx-config --libs", change to "/var/local/bin/wx-config --libs".

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: linking to a specific lib version
« Reply #6 on: April 20, 2011, 09:42:15 am »
ok thanks i figured out where that change needs to be made.
not obvious, since you need to select the project name and not the 'debug' or 'release' node underneath the "project build option"
Kind Regards,
Rajinder Yadav

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: linking to a specific lib version
« Reply #7 on: April 20, 2011, 02:04:43 pm »
ok thanks i figured out where that change needs to be made.
not obvious, since you need to select the project name and not the 'debug' or 'release' node underneath the "project build option"
It is obvious, if this setting applies to the whole project (i.e. all targets). You can setup options at project- and target level. The target level options can either be an addition or a replacement for the project options. This allows setting up common compiler/linker options very easily as it is often the case that targets share certain settings. And even if not, targets can override settings done at project level (as I've said already).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: linking to a specific lib version
« Reply #8 on: April 21, 2011, 05:23:54 am »
i figured that much out, still feel my way around CB  :P
Kind Regards,
Rajinder Yadav