Slackware Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • David
    Team Scooter
    • Oct 2009
    • 124

    #16
    Dallas,

    Some clarifications first. libqtc.so.1 is a library that BCompare uses not something that we have written ourselves. We include it since must distributions do not have it.

    When you do 'ldd' on an object the resulting paths are not hardcoded in the object but where the dynamic linker was able to find the needed libraries. So when ldd says that libqtc.so.1 is using /usr/lib/libqt-mt.so, this is not a hardcoded path in libqtc.so.1 but the first place that the linker found a copy of libqt-mt.so in your filesystem.

    Libraries can reside anywhere inside your filesystem - the key is getting the linker to find them. There are standard directories that the linker looks in /lib, /usr/lib, /usr/local/lib, etc. You can add to the search paths with the environment variable LD_LIBRARY_PATH. This is what the bcomp script does. It sets LD_LIBRARY_PATH to include the directory where libqtc.so.1 resides so that the linker can find libqtc.so.1 when it runs BCompare. This is why you cannot run BCompare straight out - LD_LIBRARY_PATH is not set to include the location of libqtc.so.1 (you can manually set LD_LIBRARY_PATH and call ./BCompare - directly though you would loose some other functionality that the bcomp script provides). (google or manpage ldconfig, ldd, ld, ld.conf).

    I believe that this is also the reason why libqtc.so.1 was not found when you did 'ldd BCompare' i.e. LD_LIBRARY_PATH was not set to include the location of libqtc.so.1 and therefore the linker could not find it.

    So back to fixing your problem.

    The library that you created does appear to have the correct symbols in it. Though we could do one more grep to make sure that the full symbol is there. So
    'grep _ZNK13QWindowsStyle9classNameEv libqt-mt.so.3'
    and verify that there is a match.

    If there is a match it should just be a matter of getting that library in the correct location that the linker can find it first before it finds the old libqt-mt.so.3.

    If it were my machine I would create a temp directory in my home directory and move all the old Qt library stuff there. Since this directory would not be in the linker search path then it should never find that old library. The test would be that if you try to run bcomp then you should see an error message about libqt-mt.so.3 not found (assuming that the new libqt-mt.so.3 is not sitting in a directory known by the linker).

    It would actually be useful to make sure that the new libqt-mt.so.1 is not in a standard searchable directory. If it is not then you can keep removing any libqt-mt.so.1's that are found when you ldd libqtc.so.1 until none are found. This way you can guarantee that it is using the one that you want it to use. Sine you have already run a 'find' on libqt-mt.so* then there are probably on the old one and the one you just created. However... it wouldn't hurt to verify that.

    I would then go ahead and copy the new libqt-mt.so.3 straight into /usr/lib (no symbolic links - the symbolic links are a convenience to allow you to easily change the link to different/new versions of the library). And then try running bcomp.

    David
    David J Scooter Software

    Comment

    • n5fee
      Journeyman
      • Oct 2009
      • 10

      #17
      David,

      That did it. It works now.

      I first moved the following 4 files to a new directory in my home directory, /home/dallas/oldqt
      /usr/lib/@libqt-mt.so
      /usr/lib/@libqt-mt.so.3
      /usr/lib/@libqt-mt.so.3.3
      /usr/lib/libqt-mt.so.3.3.8

      Next I copied the newly made files below to /usr/lib
      /usr/local/qt/lib/@libqt-mt.so
      /usr/local/qt/lib/@libqt-mt.so.3
      /usr/local/qt/lib/@libqt-mt.so.3.3
      /usr/local/qt/lib/libqt-mt.so.3.3.8

      Beyond compare started up and looks normal.

      This was a learning experience for me. Now I will build a new system from scratch so I can duplicate what all happened to make sure I understand it.

      Thanks for the help.

      Dallas

      Comment

      • David
        Team Scooter
        • Oct 2009
        • 124

        #18
        Dallas,

        Excellent. Pats on the back all the way around. Thanks for being patient and sticking with it until we got it going. Check back in if something breaks when you redo it all from scratch.

        David
        David J Scooter Software

        Comment

        • David
          Team Scooter
          • Oct 2009
          • 124

          #19
          Dallas,

          I forgot the warning. Now that you got it working with a different set of libraries and you put those libraries into the main directory (i.e. /usr/lib) you will want to keep an eye out that that change didn't break the dependencies for other apps that you use.

          Linux being the wonderful beast that it is, some apps can have some very specific requirements for the libraries that they rely on (sometimes even just version number). When you start replacing libraries or moving them around you can accidentally find those dependencies.

          This is why a lot of distributions include tools for managing apps and libraries like yum and apt. The tools help track down and watch the dependencies.

          It is also why you saw the interesting symbolic links to the libqt-mt.so that were difficult to track down. The symbolic links can be used to switch libraries quickly or mitigate issues when two different apps (that you need to run at the same time) require two different versions of the same library.

          Have fun

          David
          David J Scooter Software

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16000

            #20
            Hello n5fee,

            It would appear your email may not be set up correctly. Your forum notifications are bouncing. If you would like to address this, please double check your email in your User CP and then email [email protected] (with a link back to this forum post).

            Thanks.
            Aaron P Scooter Software

            Comment

            • n5fee
              Journeyman
              • Oct 2009
              • 10

              #21
              For the benefit of anyone interested in Slackware here is the condensed version of all of the earlier messages. Here are the steps I used to get Beyond Compare 3.1.7.10865 running in both Slackware 12.1 and 12.2

              Dowload qt-x11-free-3.3.8b.tar.bz2 and place file in /usr/local.
              # cd /usr/local
              # tar -xvf qt-x11-free-3.3.8b.tar.bz2
              # chown -R root:root /usr/local/qt-x11-free-3.3.8b (my file had non root owners and groups)
              # mv qt-x11-free-3.3.8b qt (rename according to instructions README)

              # cd /root
              look for .profile
              I do not have one, so make one and put some stuff in it according to directions in README
              # touch .profile
              Add several lines to .profile

              QTDIR=/usr/local/qt
              PATH=$QTDIR/bin:$PATH
              MANPATH=$QTDIR/doc/man:$MANPATH
              LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

              Save /root/.profile

              # export QTDIR PATH MANPATH LD_LIBRARY_PATH

              logout as root then log back in as root

              # cd /usr/local/qt

              # ./configure -thread
              # make
              # make install

              The make and install took about 3 hours on my old Dell L400 laptop

              I swaped the following files around using Midnight Commander (included in slackware type mc from command prompt.)

              Move the following 4 files to a new folder out of the way. I moved them to /home/tempqt
              /usr/lib/@libqt-mt.so
              /usr/lib/@libqt-mt.so.3
              /usr/lib/@libqt-mt.so.3.3
              /usr/lib/@libqt-mt.so.3.3.8

              Copy the following 4 new files to /usr/lib to replace the 4 we just hid away.
              /usr/local/qt/lib/@qt-mt.so
              /usr/local/qt/lib/@qt-mt.so.3
              /usr/local/qt/lib/@qt-mt.so.3.3/
              /usr/local/qt/lib/qt-mt.so.3.3.8

              Beyond compare appears to work fine now. I have not noticed anything else not working as a result of my changes.

              Comment

              Working...