0

I am running Ubuntu 14.04 LTS, 64-bit. I am trying to install Notepadqq, the port of Notepad++ from Windows to Linux. I know about Vim and Emacs but I am used to Notepad++ and I like it. I installed Notepad using this web page:

http://notepadqq.altervista.org/wp/

When I ran it, a dialog box popped up complaining that I had an old version of Qt on my box, Qt 5.2.1. I then downloaded and installed Qt 5.3.0 using these instructions:

wget http://download.qt-project.org/official_releases/qt/5.3/5.3.0/qt-opensource-linux-x64-5.3.0.run

chmod +x qt-opensource-linux-x64-5.3.0.run

./qt-opensource-linux-x64-5.3.0.run

From this web page:

http://www.sysads.co.uk/2014/05/install-qt-5-3-ubuntu-14-04/

The installation process went smoothly without any errors reported. However, when I run Notepadqq I still get the dialog box complaining about Qt. I am nervous about uninstalling Qt 5.2.1 because I'm betting there are a lot of other code dependent on that library? So is this a path or an environment variable thing? How can I fix this?

ANECDOTE: Last Linux box I set up was OpenSuse 9.x, a long time ago. Linux sure has come a long way and Ubuntu 14.04 is beautiful. My thanks to the Ubuntu team.

1
  • 1
    Ooh, installing libraries via run scripts is dicey. I always prefer to take the .deb package when possible, because all dependencies will be handled for you and if you use a depository/ppa you will get auto-updates. So I don't know the exact software you use, but notepadqq might be linked to one Qt library and you have installed the new one somewhere completely different. So what was the install path for Qt5.3 and could you type "ldd <notepadqq-binary>" into the terminal. you might want to look for it with "locate notepadqq" Sep 26 '14 at 14:47
4

If your distribution doesn't provide Qt 5.3, Notepadqq expects it to be located at ~/Qt/, in your home directory.

So, when you run ./qt-opensource-linux-x64-5.3.0.run and it asks where you want to install Qt, use the path /home/<your_username>/Qt. A symlink will work too.

By the way, you might want to use the currently latest Qt version (5.3.2):

wget http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-linux-x64-5.3.2.run
chmod +x qt-opensource-linux-x64-5.3.2.run
./qt-opensource-linux-x64-5.3.2.run

What if I already have another version of Qt in ~/Qt?

Let's say you already have an older version of Qt installed in ~/Qt: Notepadqq will ignore it.

Now, to make Qt5.3 available to Notepadqq, you can install it in a directory of your choice (let's say ~/Qt53). Then you create a symbolic link to the inner "5.3" folder, like the following:

ln -dsr ~/Qt53/5.3 ~/Qt

The two versions of Qt will coexist without any problem and notepadqq will be able to find the files in ~/Qt53/5.3

2
  • What if there is an old version of Qt in that directory. Could you expand your answer to address the risks/implications of that condition? Sep 26 '14 at 19:43
  • I've just expanded the answer with the additional info.
    – danieleds
    Sep 26 '14 at 20:29
0

Related to this issue: If you have installed the latest Qt 5.6, you need to modify the notepadqq file found under /usr/bin. Remember to edit the notepadqq file with super user privileges, otherwise you will get "access denied".

This is what my configuration file looks like after editing:

#!/bin/sh
SCRIPTPATH="$(dirname "$(readlink -f "$0")")"

if [ `getconf LONG_BIT` = "64" ]
then
    GCC_DIR=gcc_64
else
    GCC_DIR=gcc
fi

OPT_QT56=/opt/Qt/5.6/$GCC_DIR/lib
OPT_QT55=/opt/Qt/5.5/$GCC_DIR/lib
OPT_QT54=/opt/Qt/5.4/$GCC_DIR/lib
OPT_QT53=/opt/Qt/5.3/$GCC_DIR/lib
PERSONAL_QT56=~/Qt/5.6/$GCC_DIR/lib
PERSONAL_QT55=~/Qt/5.5/$GCC_DIR/lib
PERSONAL_QT54=~/Qt/5.4/$GCC_DIR/lib
PERSONAL_QT53=~/Qt/5.3/$GCC_DIR/lib

export LD_LIBRARY_PATH="$OPT_QT56:$PERSONAL_QT56:$OPT_QT55:$PERSONAL_QT55:$OPT_QT54:$PERSONAL_QT54:$OPT_QT53:$PERSONAL_QT53:${LD_LIBRARY_PATH}"

if [ -f "$SCRIPTPATH"/../lib/notepadqq/notepadqq-bin ]; then
    # Nqq is installed: this script is in bin/
    exec "$SCRIPTPATH"/../lib/notepadqq/notepadqq-bin "$@"
elif [ -f "$SCRIPTPATH"/../lib/notepadqq-bin ]; then
    # Nqq is not installed: this script is in bin/
    exec "$SCRIPTPATH"/../lib/notepadqq-bin "$@"
else
    # Nqq is installed via deb package:
    # this script is in the same directory as the binary file.
    exec "$SCRIPTPATH"/notepadqq-bin "$@"
fi
0

I've installed the latest Qt 5.10.1 from http://download.qt.io/official_releases/qt/5.10/5.10.1/ to the local folder ~/Qt5.10.1, then created the link in the ~/ folder with ln -dsr ~/Qt5.10.1/5.10.1 ~/Qt but notepadqq still was complaining about the wrong version of qt = 5.2.1. Then I changed the file /usr/bin/notepadqq as follows (because there was no option for version 5.10.1 in the script):

#!/bin/sh
SCRIPTPATH="$(dirname "$(readlink -f "$0")")"

if [ `getconf LONG_BIT` = "64" ]
then
    GCC_DIR=gcc_64
else
    GCC_DIR=gcc
fi

OPT_QT5101=/opt/Qt/$GCC_DIR/lib
OPT_QT59=/opt/Qt/5.9/$GCC_DIR/lib
OPT_QT58=/opt/Qt/5.8/$GCC_DIR/lib
OPT_QT57=/opt/Qt/5.7/$GCC_DIR/lib
OPT_QT56=/opt/Qt/5.6/$GCC_DIR/lib
OPT_QT55=/opt/Qt/5.5/$GCC_DIR/lib
OPT_QT54=/opt/Qt/5.4/$GCC_DIR/lib
OPT_QT53=/opt/Qt/5.3/$GCC_DIR/lib
PERSONAL_QT5101=~/Qt/$GCC_DIR/lib
PERSONAL_QT59=~/Qt/5.9/$GCC_DIR/lib
PERSONAL_QT58=~/Qt/5.8/$GCC_DIR/lib
PERSONAL_QT57=~/Qt/5.7/$GCC_DIR/lib
PERSONAL_QT56=~/Qt/5.6/$GCC_DIR/lib
PERSONAL_QT55=~/Qt/5.5/$GCC_DIR/lib
PERSONAL_QT54=~/Qt/5.4/$GCC_DIR/lib
PERSONAL_QT53=~/Qt/5.3/$GCC_DIR/lib

export LD_LIBRARY_PATH="$OPT_QT5101:$PERSONAL_QT5101:$OPT_QT59:$PERSONAL_QT59:$OPT_QT58:$PERSONAL_QT58:$OPT_QT57:$PERSONAL_QT57:$OPT_QT56:$PERSONAL_QT56:$OPT_QT55:$PERSONAL_QT55:$OPT_QT54:$PERSONAL_QT54:$OPT_QT53:$PERSONAL_QT53:${LD_LIBRARY_PATH}
...skipped...

and only then notepadqq works without complains about the qt version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.