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. [Solved] Problem with CMake and QT 5 dlls in Windows
Forum Updated to NodeBB v4.3 + New Features

[Solved] Problem with CMake and QT 5 dlls in Windows

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 2 Posters 7.4k 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.
  • X Offline
    X Offline
    XxOsurfer3xX
    wrote on last edited by
    #1

    I am creating a CMake file for compiling a simple hello world program that uses QtCore. I use CMake to generate a VS 2012 project and it compiles fine. But when I execute it, it gives an error that says that Qt5Core.dll is missing.

    I can fix this copying the .dll manually into the executable's directory, but I don't like this solution. Here is my CMake file:

    @
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set (CMAKE_PREFIX_PATH "C:\qt_src\qt5-2010\qtbase\")
    FIND_PACKAGE(Qt5Core REQUIRED)

    SET(SOURCE
    main.cpp
    )

    add_executable(toview ${SOURCE})
    qt5_use_modules(toview Core)@

    Am I missing something? Is there a better way to do this? Thanks in advance!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bjanuario
      wrote on last edited by
      #2

      Did you check your Qt environment path ?

      1 Reply Last reply
      0
      • X Offline
        X Offline
        XxOsurfer3xX
        wrote on last edited by
        #3

        I compiled QT myself, in my environment I only created QTDIR=C:\qt_src\qt5-2010\qtbase.

        Am I missing something? Do I need to add the bin path to PATH?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bjanuario
          wrote on last edited by
          #4

          Yes you need to put not only the bin, but also the lib path

          1 Reply Last reply
          0
          • X Offline
            X Offline
            XxOsurfer3xX
            wrote on last edited by
            #5

            Ok, thanks a lot. Problem solved.

            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