1

I have problem regarding installation - when I want to compile KeePassX with cmake there is error with QtCore. I tried installing libqtcore, I got E: Unable to locate package libqt4-core
Output of compiling KeePassX:

cmake [-DCMAKE_INSTALL_PREFIX=/usr/local] ..
-- The C compiler identification is GNU 5.3.1
-- The CXX compiler identification is GNU 5.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test WERROR_C_AVAILABLE
-- Performing Test WERROR_C_AVAILABLE - Success
-- Performing Test WERROR_CXX_AVAILABLE
-- Performing Test WERROR_CXX_AVAILABLE - Success
CMake Warning at /usr/share/cmake-3.5/Modules/FindQt4.cmake:626 (message):
  /usr/bin/qmake reported QT_INSTALL_LIBS as "/usr/lib/x86_64-linux-gnu" but
  QtCore could not be found there.  Qt is NOT installed correctly for the
  target build environment.
Call Stack (most recent call first):
  CMakeLists.txt:151 (find_package)


CMake Error at /usr/share/cmake-3.5/Modules/FindQt4.cmake:634 (message):
  Could NOT find QtCore.  Check
  /home/mike/Downloads/keepassx-2.0.2/build/CMakeFiles/CMakeError.log for
  more details.
Call Stack (most recent call first):
  CMakeLists.txt:151 (find_package)


-- Configuring incomplete, errors occurred!  

Output after trying to install Qt with sudo apt install libqtcore4:

sudo apt install libqtcore4
[sudo] password for mike: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libqtcore4 is already the newest version (4:4.8.7+dfsg-5ubuntu2).
libqtcore4 set to manually installed.
The following packages were automatically installed and are no longer required:
  ca-certificates-mono cli-common kde-l10n-cs kde-l10n-engb
  libmono-corlib2.0-cil libmono-corlib4.5-cil libmono-i18n-west4.0-cil
  libmono-i18n4.0-cil libmono-security4.0-cil
  libmono-system-configuration4.0-cil libmono-system-security4.0-cil
  libmono-system-xml4.0-cil libmono-system4.0-cil libmonoboehm-2.0-1
  libpkcs11-helper1 mono-4.0-gac mono-gac mono-runtime mono-runtime-common
  mono-runtime-sgen mono-utils openvpn stunnel4
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  

I googled little bit about it today, and I found these three commands, however, I dont know how to exactly write them:

export QTDIR="/path/to/qt-5.0.1"
export PATH="${QTDIR}/bin:${PATH}"

There's this variable which might be usefull when working with cmake:

export CMAKE_PREFIX_PATH="${QTDIR}"

It adds the path to Qt to Cmake's search path.

PKM
  • 829
  • Is this on Ubuntu 16.04? – edwinksl May 25 '16 at 23:02
  • Yes, and I didnt do any changes regarding QtCore, so I guess it was not installed from the start – PKM May 25 '16 at 23:09
  • Can you try sudo apt install libqtcore4? – edwinksl May 25 '16 at 23:10
  • Done, output added into question – PKM May 25 '16 at 23:28
  • Hmm, so you have libqtcore4, which I guess is different from libqt4-core? – edwinksl May 25 '16 at 23:32
  • I dont know whether its different or not, but based on QtCore could not be found there. Qt is NOT installed correctly for the target build environment. and libqtcore4 is already the newest version (4:4.8.7+dfsg-5ubuntu2). I think I have Qt in my system, but in some other directory and cmake cant find it. Is there any way to see destination of Qt and then guide cmake to it manually? – PKM May 25 '16 at 23:44
  • Yeah I am just looking through the interwebs to see what I can find. – edwinksl May 25 '16 at 23:45
  • I did a small research today too, I edited main question with what I found, please check it – PKM May 26 '16 at 12:15

1 Answers1

4

Try installing libqt4-dev to install the Qt4 development files.

gsxruk
  • 1,380
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Pilot6 May 28 '16 at 07:57
  • Hi. I'm unsure how this doesn't represent a possible answer? The question, or problem in this case, is that an application will not compile. This may be due to missing libraries which the above may provide and solve the problem which surely represents a possible answer? The text in the comments box states "Avoid answering questions in comments". I also can't see how the above could be classed as a critique or clarification request? – gsxruk May 28 '16 at 08:58
  • Command worked (thanks!), but I am still missing one or more libraries. Now it says Could NOT find Gcrypt - can you please tell me exact name of that package for Ubuntu or where could I find it? – PKM May 30 '16 at 16:39
  • Hi. That's a different question so you should probably raise a new question for that one. I don't know much about Gcrypt. I did a quick search and found this answered question that may help. Please mark this as the answer if you feel it solved your original issue. Thanks. – gsxruk May 30 '16 at 16:58
  • I dont need to create new question, because that thread in your answer helped me to install all needed libraries and cmake works. Thanks again! – PKM May 30 '16 at 17:19