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. QtGui doesn't add linker dependency to libGLESv2
Forum Updated to NodeBB v4.3 + New Features

QtGui doesn't add linker dependency to libGLESv2

Scheduled Pinned Locked Moved Installation and Deployment
1 Posts 1 Posters 1.1k 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.
  • E Offline
    E Offline
    Elador
    wrote on last edited by
    #1

    I am trying to take the Qt example from examples/gui/openglwindow/ and make it compile/run with CMake. However, when compiling, it fails with a bunch of
    "error LNK2019: unresolved external symbol __imp_glClear"

    I can fix that by manually adding C:\Qt_install\lib\libGLESv2d.lib to the linker path, however, that's obviously not how CMake should work.

    The CMakeLists is very simple:
    @
    PROJECT( oglwin )
    CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 )
    cmake_policy(SET CMP0020 NEW) # for Qt: auto-link to qtmain.lib

    set(CMAKE_AUTOMOC ON)
    find_package(Qt5Core REQUIRED)
    find_package(Qt5Gui REQUIRED)

    SET(SOURCE
    main.cpp
    openglwindow.cpp
    )
    SET(HEADERS
    openglwindow.h
    )
    ADD_EXECUTABLE( oglwin ${SOURCE} ${HEADERS} )
    TARGET_LINK_LIBRARIES( oglwin Qt5::Core Qt5::Gui )
    @

    Now as I mentioned before, my expectation would be that this automatically links to libGLESv2.lib (or libGLESv2d.lib), as I am using a Qt-build built with ANGLE.
    (For that matter, I guess when on the desktop/opengl build, it should link to GL.lib [or whatever the system openGL lib is called]).

    Possibly in my case, it should also link to C:\Qt_install\lib\libEGLd.lib?

    There are a few related topics around, for example this:
    https://bugreports.qt-project.org/browse/QTBUG-29132
    (where it says "fixed"), and one can follow that to gitorious:
    https://codereview.qt-project.org/#change,53857

    Apparently what I'm trying to do should work, but it doesn't. Am I doing something wrong?

    Thank you in advance!

    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