0

ALL,

I'm trying to test my program on Linux.

I have a Gentoo box that recently was updated and now I'm trying to build my application. Before the update I was using wxWidgets-3.1.4 amd now after the update I built 3.1.7.

I usse Anjuta as an IDE, and wxWidgets for development.

Everything builds fine, but when runningI fet an error stating that the linker can't find the old version of the wx (from 3..4).

I did some checking and here is what I found:

When the libraries of my project are built everything is fine:

igor@IgorReinCloud ~/dbhandler/Debug/libdialogs $ ldd .libs/libdialogs.so | grep libwx_gtk3u_xrc
    libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f377cf7c000)
igor@IgorReinCloud ~/dbhandler/Debug/libdialogs $ cd ../libdbwindow/
igor@IgorReinCloud ~/dbhandler/Debug/libdbwindow $ ldd .libs/libdbwindow.so | grep libwx_gtk3u_xrc
    libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f0e058f9000)
igor@IgorReinCloud ~/dbhandler/Debug/libdbwindow $ 

But after I run make install:

igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/bin/dbhandler | grep libwx_gtk3u_xrc
    libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f74f5866000)
igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/lib/libdialogs.so | grep libwx_gtk3u_xrc
    libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f49dd3f4000)
    libwx_gtk3u_xrc-3.1.so.4 => not found
    libwx_gtk3u_xrc-3.1.so.4 => not found
igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/lib/libdbloader.so | grep libwx_gtk3u_xrc
    libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f15b44ba000)
igor@IgorReinCloud ~/dbhandler $ ldd /usr/local/lib/libdbwindow.so | grep libwx_gtk3u_xrc
    libwx_gtk3u_xrc-3.1.so.7 => /home/igor/wxWidgets/buildGTK/lib/libwx_gtk3u_xrc-3.1.so.7 (0x00007f31a3985000)
    libwx_gtk3u_xrc-3.1.so.4 => not found
    libwx_gtk3u_xrc-3.1.so.4 => not found
    libwx_gtk3u_xrc-3.1.so.4 => not found
igor@IgorReinCloud ~/dbhandler $ 

My question would be - how do I fix it?

My understanding is that make install should just copy the stuff to /usr/local and relink as necessary to use the libraries fro that new place.

However, for some unknown reason when Makefiles wre regenerated, something happened and I somehow ended up with old and new occurrences of wx in the "make install" section.

Did the OS upgrade screw this up? I can't go back (and don't want to) as a lot of things are gone.

Presumably I should do "make distclean" (or maybe even remove everything from /usr/local/lib manually), remove the build directory and re-run configure + make. Anything I am missing?

Thank you.

Igor
  • 5,620
  • 11
  • 51
  • 103
  • You have tagged [autotools]. Does your project use `libtool`? Are there, perchance, `.la` files in your project build directory dating from before the system updates? This is one conceivable issue, and if that's the problem then you could probably resolve it by deleting the `.la` files (forcing a rebuild of the libraries, but not necessarily any recompilation). – John Bollinger Jul 05 '22 at 23:47
  • @JohnBollinger. it uses configure and make. Does it count? And yes - there are `la` files that are building in my project. And no - the build directory is rebuilt every time. I just do `rm -rf Debug && mkdir Debug` and then re-run configure and make. Then problem is that building is fine - its running `make install` that is at fault. – Igor Jul 06 '22 at 04:00
  • I understand that the problem occurs at install time. The `.la` files contain information that is used at that time, and which could affect the installed libraries' dynamic linking. But perhaps that's too fine an analysis. Does the problem persist if you perform a clean build from absolute scratch? – John Bollinger Jul 06 '22 at 12:13
  • @JohnBollinger, yes completely removed the build directory, re-run everythig starting from `libtoolize` and still the library referencing the old version which doesn't exit. Also - sorry for the long delay... – Igor Jul 25 '22 at 05:04
  • You mentioned using an Anjuta. Are you running the build / install via that IDE? If so, then perhaps some record of your old system configuration is stuck there. Do you see the same issue If you run a clean `configure`, `make`, and `make install` from the command line? – John Bollinger Jul 25 '22 at 12:31
  • And are any of the other shared library references resolving differently in the installed copy than in the build-tree copy? I mean the actual .so file, not just the SONAME. Because one possibility is that the stale references are coming in indirectly via another shared-library dependency. – John Bollinger Jul 25 '22 at 12:34
  • Note also that it is suspicious that dependencies in the installed version are resolving to libraries anywhere under your home directory. That looks like you are linking against an uninstalled copy of wx, and relying on `RPATH`, `RUNPATH` and / or `LD_LIBRARY_PATH` to find it. I strongly recommend installing `wx` to a system directory, preferably in the standard library search path, and building against that copy. – John Bollinger Jul 25 '22 at 12:40

0 Answers0