Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Compilation problems in environment with Qt 4.8 and 5.1
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Compilation problems in environment with Qt 4.8 and 5.1

Scheduled Pinned Locked Moved General and Desktop
11 Posts 5 Posters 8.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tiredtyrant
    wrote on last edited by
    #1

    Hello, I need some help figuring out what is going on here.

    I'm on Ubuntu 12. I've installed Qt 5.1 and Qt 4.8 on my system (in this order). For both, I used the downloads from Qt's website instead of searching the software center. After installing Qt 4.8, I had to manually add the 4.8 version and kit to Qt Creator. By the way, I'm using the Qt Creator that came with the Qt 5.1 installation, since the Qt 4.8 install didn't come with Qt Creator.

    I tried compiling a 4.8 project, and for some reason it gave me errors related to libQt5Core:

    @/usr/bin/ld: warning: libicui18n.so.51, needed by /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
    /usr/bin/ld: warning: libicuuc.so.51, needed by /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_toUnicode_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucol_setAttribute_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ures_open_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_open_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_close_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_getMaxCharSize_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucol_close_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_countAliases_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucol_open_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_getStandardName_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucol_getSortKey_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to u_strToUpper_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to u_errorName_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucol_getAttribute_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_getDefaultName_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to u_strToLower_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_getAlias_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucol_strcoll_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_setSubstChars_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_countAvailable_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_compareNames_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ucnv_fromUnicode_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ures_getStringByKey_51' /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to ures_close_51'
    /home/person/Qt5.1.0/5.1.0/gcc/lib/libQt5Core.so.5: undefined reference to `ucnv_getAvailableName_51'
    collect2: ld returned 1 exit status
    make: *** [TheProject] Error 1
    10:20:42: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project TheProject (kit: Qt 4.8.5)
    When executing step 'Make'@

    Somehow the build process is looking for Qt 5.1 stuff. I have no idea why. Could it be an environment variable that was set when installing Qt 5.1 that I don't know of? What is the problem?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you sure your project is using the right kit ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tiredtyrant
        wrote on last edited by
        #3

        Thanks for the quick reply!

        I think I am... I had to add the kit manually though, after installing 4.8. All I did was add Qt 4.8 as a version manually and create a new kit using this version. Is that enough?

        Here's a screenshot of the kit I'm using to compile the project:

        !http://i.imgur.com/LWsL6Xw.png(screenshot)!

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Those are general Qt Creator settings. You need to modify settings for your specific project: click on "Project" button on the left-side pane in Qt Creator while your project is open.

          (Z(:^

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tiredtyrant
            wrote on last edited by
            #5

            The 'Qt 4.8.5' kit I created is the one I'm using to compile this project.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tiredtyrant
              wrote on last edited by
              #6

              This is an excerpt of the Makefile generated by qmake for this project:

              @####### Compiler, tools and options

              CC = gcc
              CXX = g++
              DEFINES = -DSQLITE_THREADSAFE=0 -DARQUIVO_DEBUG -D_TTY_POSIX_ -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
              CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES)
              CXXFLAGS = -pipe -fpermissive -g -Wall -W -D_REENTRANT $(DEFINES)
              INCPATH = -I../../../../Qt-4.8.5/mkspecs/linux-g++ -I. -I../../../../Qt-4.8.5/include/QtCore -I../../../../Qt-4.8.5/include/QtNetwork -I../../../../Qt-4.8.5/include/QtGui -I../../../../Qt-4.8.5/include/QtXml -I../../../../Qt-4.8.5/include/QtSql -I../../../../Qt-4.8.5/include -I/home/person/Projetos/trunk/fonte/TheProject/../fonte/qextserialport-1.2rc/src -I. -Ilib -I. -I.
              LINK = g++
              LFLAGS = -Wl,-rpath,/home/person/Qt-4.8.5/lib
              LIBS = $(SUBLIBS) -L/home/person/Qt-4.8.5/lib -L/home/person/Projetos/trunk/fonte/TheProject/lib/build -L/home/person/Projetos/trunk/fonte/TheProject/ -lconvecf -L/home/person/Projetos/trunk/fonte/TheProject/lib/build/ -lqextserialport -lAssinatura -lQtSql -L/home/person/Qt-4.8.5/lib -lQtXml -lQtGui -L/usr/X11R6/lib -lQtNetwork -lQtCore -lpthread
              AR = ar cqs
              RANLIB =
              QMAKE = /home/person/Qt-4.8.5/bin/qmake
              TAR = tar -cf
              COMPRESS = gzip -9f
              COPY = cp -f
              SED = sed
              COPY_FILE = $(COPY)
              COPY_DIR = $(COPY) -r
              STRIP = strip
              INSTALL_FILE = install -m 644 -p
              INSTALL_DIR = $(COPY_DIR)
              INSTALL_PROGRAM = install -m 755 -p
              DEL_FILE = rm -f
              SYMLINK = ln -f -s
              DEL_DIR = rmdir
              MOVE = mv -f
              CHK_DIR_EXISTS= test -d
              MKDIR = mkdir -p@

              You can see I'm using the correct kit.

              1 Reply Last reply
              0
              • JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                Try:

                Build -> Clean Project "XYZ"

                Build -> Run qmake

                Build -> Build Project "XYZ"

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tiredtyrant
                  wrote on last edited by
                  #8

                  Thanks for replying JKSH,

                  I did that a few times already, and it has not changed the result. I'm completely out of ideas...

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    tiredtyrant
                    wrote on last edited by
                    #9

                    I figured it out... turns out I was trying to link to a library that was compiled with Qt 5.1.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mellow
                      wrote on last edited by
                      #10

                      [quote author="tiredtyrant" date="1374005189"]I figured it out... turns out I was trying to link to a library that was compiled with Qt 5.1. [/quote]

                      How do you fix that?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        He probably rebuild the library using Qt5 and linked to that one.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved