Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. LibQtGui.so brings 51 undefined reference errors when linking Qt.
Qt 6.11 is out! See what's new in the release blog

LibQtGui.so brings 51 undefined reference errors when linking Qt.

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 3 Posters 10.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.
  • B Offline
    B Offline
    blissfreak
    wrote on last edited by
    #1

    Hi, I'm on Sabayon Linux ( a fork of Gentoo), and while I've just started using Qt, I've been able to compile and run my programs in Qt Creator for a while now without any issues. It's only when I pass Config += qt that I get issues. I've tried passing in core or gui, just as is, but that still won't allow the actual project to compile.

    Here are my errors:

    @/home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_read_info@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_gAMA@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_get_tRNS@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_PLTE@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_filler@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_get_text@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_packing@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_write_rows@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_invert_mono@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_error_fn@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_write_chunk@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_get_image_width@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_IHDR@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_sig_bytes@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_read_update_info@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_interlace_handling@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_write_fn@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_write_end@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_create_read_struct@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_read_image@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_set_gray_to_rgb@PNG12_0' /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to png_get_IHDR@PNG12_0'
    /home/holland/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `png_get_channels@PNG12_0'@

    I'm not quite sure what to do about this. I've tried reinstalling the sdk, and while that has gone fairly smoothly, I still haven't been able to get this working on my development machine. Everything is up to date, as well.

    QMake File

    @TEMPLATE = app
    win32:CONFIG += console
    CONFIG += qt core gui

    QMAKE_CXX_FLAGS += -std=c++0x

    SOURCES +=
    VI_GL.cpp
    VI_Initialize.cpp
    VI_Unix.cpp
    VI_Util.cpp
    VI_Win.cpp
    VI_ByteBuf.cpp

    HEADERS +=
    VI_Includes.h
    VI_Win.h
    VI_Unix.h
    VI_Math.h
    VI_GL.h
    VI_Util.h
    VI_ByteBuf.h

    win32:LIBS += -glew32 -lglu32 -lopengl32 -lkernel32 -lgdi32 -luser32 -lws2_32

    unix:LIBS += -lX11 -lGLEW -lGLU -lGL -lXext -L/usr/X11R6/lib@

    Thank you to anyone who can provide assistance. :)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      Perhaps libpng isn't available in the library path.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blissfreak
        wrote on last edited by
        #3

        Should I just do export PATH = /path/to/libpng/?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          If it's not seeing it at compile time,
          @
          LIBS += -L/path/to/libpng/location
          @

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            blissfreak
            wrote on last edited by
            #5

            Hmm...I've tried both export PATH and your LIBS method; unfortunately, they don't work. Do you have any other ideas?

            Edit

            It looks like I'm able to pass CONFIG = opengl | core | gui, just no += operator.

            I can't get CONFIG = qt, however.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Looks like you're missing

              @
              unix:LIBS += -lpng
              @

              It's strange that it's not added by qmake, though, as it is a dependency of QtGui lib, and not directly of your code.

              One cause could be that you have libpng installed, but the version doesn't match with that required by the SDK.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                blissfreak
                wrote on last edited by
                #7

                Damn, that one didn't work either. :(

                I think you're right, though: my libpng version is 1.5.6 AND 1.4.8, so I'm guessing Qt must not be referencing these properly. Is there somewhere I can go and edit a few things to tinker around with this?

                Edit

                I got it to work!

                For Sabayon users, just do:

                @
                equo search libpng
                equo install libpng-1.2.46
                @

                It seems like Qt's version is a few versions behind, but regardless, this will definitely allow you do build your projects with Qt now!

                :)

                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