Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT MSVC Protobuf C++ - Run time error
Forum Updated to NodeBB v4.3 + New Features

QT MSVC Protobuf C++ - Run time error

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 436 Views
  • 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.
  • V Offline
    V Offline
    VimHar
    wrote on last edited by VimHar
    #1

    Hi everyone,

    Im using windows QT 5.15 MSVC 2019 64 bit configuration.

    I have installed protobuf using vcpkg.
    Also I can able to link the library as follows

    LIBS += -LC:\vcpkg\installed\x64-windows\lib -llibprotobuf

    I can able to build the code succesfully. But while running Im getting the pop up stating cannot find dll as below.
    8dd76bed-db8c-4abc-a31c-8d1fe63bcc87-image.png

    My. pro file
    QT -= gui

    CONFIG += c++11 console
    CONFIG -= app_bundle

    LIBS += -LC:\vcpkg\installed\x64-windows\lib -llibprotobuf

    INCLUDEPATH += C:\vcpkg\installed\x64-windows\include

    HEADERS +=
    m.pb.h

    SOURCES +=
    main.cpp
    m.pb.cc

    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target

    1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      @VimHar said in QT MSVC Protobuf C++ - Run time error:

      In that case how can we link each library specifically for debug and release. Kindly add!

      See qmake scopes

      V Offline
      V Offline
      VimHar
      wrote on last edited by
      #4

      @Christian-Ehrlicher Thank You!

      1 Reply Last reply
      0
      • V Offline
        V Offline
        VimHar
        wrote on last edited by
        #2

        Hey I got the solution,
        the reason is the software couldnt able to find the location of dll specified in path.
        Even I have added the direct bin path into PATH environment variable.

        Then I added the respective dll path from "debug" folder. It worked.

        Think the QT has two modes debug and release, each mode needs specific dll in that case,

        Correct me if im wrong?
        In that case how can we link each library specifically for debug and release. Kindly add!

        Christian EhrlicherC 1 Reply Last reply
        0
        • V VimHar

          Hey I got the solution,
          the reason is the software couldnt able to find the location of dll specified in path.
          Even I have added the direct bin path into PATH environment variable.

          Then I added the respective dll path from "debug" folder. It worked.

          Think the QT has two modes debug and release, each mode needs specific dll in that case,

          Correct me if im wrong?
          In that case how can we link each library specifically for debug and release. Kindly add!

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #3

          @VimHar said in QT MSVC Protobuf C++ - Run time error:

          In that case how can we link each library specifically for debug and release. Kindly add!

          See qmake scopes

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          V 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            @VimHar said in QT MSVC Protobuf C++ - Run time error:

            In that case how can we link each library specifically for debug and release. Kindly add!

            See qmake scopes

            V Offline
            V Offline
            VimHar
            wrote on last edited by
            #4

            @Christian-Ehrlicher Thank You!

            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