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. undefined reference to `_com_util::ConvertBSTRToString(wchar_t*)'
Forum Update on Monday, May 27th 2025

undefined reference to `_com_util::ConvertBSTRToString(wchar_t*)'

Scheduled Pinned Locked Moved Unsolved General and Desktop
undefined refercomutil
9 Posts 3 Posters 1.6k 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.
  • Y Offline
    Y Offline
    yangyanhui4
    wrote on last edited by
    #1

    the following is the .pro file,what have I miss,I have include <comutil>
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    greaterThan(QT_MAJOR_VERSION, 4): QT += multimedia

    TARGET = FFMPEGQT
    TEMPLATE = app

    The following define makes your compiler emit warnings if you use

    any feature of Qt which has been marked as deprecated (the exact warnings

    depend on your compiler). Please consult the documentation of the

    deprecated API in order to know how to port your code away from it.

    DEFINES += QT_DEPRECATED_WARNINGS

    You can also make your code fail to compile if you use deprecated APIs.

    In order to do so, uncomment the following line.

    You can also select to disable deprecated APIs only up to a certain version of Qt.

    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

    CONFIG += c++11

    INCLUDEPATH += $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/include \

    LIBS += $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/avcodec.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/avdevice.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/avfilter.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/avformat.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/avutil.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/postproc.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/swresample.lib
    $$PWD/ffmpeg-20200528-c0f01ea-win64-dev/lib/swscale.lib
    LIBS += -lole32
    LIBS += -loleaut32
    LIBS += -lstrmiids

    SOURCES +=
    main.cpp
    mainwindow.cpp
    workthread.cpp

    HEADERS +=
    mainwindow.h
    workthread.h

    FORMS +=
    mainwindow.ui
    UI_DIR=./UI

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

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

      Hi
      From here
      https://docs.microsoft.com/en-us/cpp/cpp/convertbstrtostring?view=vs-2019
      seems you also have to link
      comsuppw.lib or comsuppwd.lib

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

        Hi, this is actually not a Qt-related error.
        You should learn to read Microsoft API docs, espcially the Requirements part, it tells you the header to include and the lib to link.
        Also, when posting, better to wrap your file content with "code" tag (click </>), that'll make it easier to read.

        1 Reply Last reply
        2
        • Y Offline
          Y Offline
          yangyanhui4
          wrote on last edited by
          #4

          i haved added #pragma comment(lib, "comsuppw.lib") but the problem also exists

          mrjjM 1 Reply Last reply
          0
          • Y yangyanhui4

            i haved added #pragma comment(lib, "comsuppw.lib") but the problem also exists

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @yangyanhui4

            Did you try
            LIBS += -lcomsuppw

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              yangyanhui4
              wrote on last edited by
              #6

              error: cannot find -lcomsuppw

              mrjjM 1 Reply Last reply
              0
              • Y yangyanhui4

                error: cannot find -lcomsuppw

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @yangyanhui4

                Then maybe you dont have it ?
                What windows version and compiler are you using ?

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  yangyanhui4
                  wrote on last edited by
                  #8

                  WIN8.1 QT5.12 mingw 64-bit

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    Bonnie
                    wrote on last edited by
                    #9

                    Are you using MinGW kit?
                    This is a MSVC lib. You need to install MSVC build tools and use MSVC version of Qt.

                    1 Reply Last reply
                    1

                    • Login

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