undefined reference to `_com_util::ConvertBSTRToString(wchar_t*)'
-
wrote on 27 Jul 2020, 09:13 last edited by
the following is the .pro file,what have I miss,I have include <comutil>
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += multimediaTARGET = FFMPEGQT
TEMPLATE = appThe 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 += -lstrmiidsSOURCES +=
main.cpp
mainwindow.cpp
workthread.cppHEADERS +=
mainwindow.h
workthread.hFORMS +=
mainwindow.ui
UI_DIR=./UIqnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target -
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 -
wrote on 27 Jul 2020, 09:33 last edited by
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. -
wrote on 28 Jul 2020, 05:41 last edited by
i haved added #pragma comment(lib, "comsuppw.lib") but the problem also exists
-
i haved added #pragma comment(lib, "comsuppw.lib") but the problem also exists
Did you try
LIBS += -lcomsuppw -
wrote on 28 Jul 2020, 05:52 last edited by
error: cannot find -lcomsuppw
-
error: cannot find -lcomsuppw
Then maybe you dont have it ?
What windows version and compiler are you using ? -
wrote on 28 Jul 2020, 06:05 last edited by
WIN8.1 QT5.12 mingw 64-bit
-
wrote on 28 Jul 2020, 06:06 last edited by
Are you using MinGW kit?
This is a MSVC lib. You need to install MSVC build tools and use MSVC version of Qt.
8/9