QCamera error LNK1120 (with Visual Studio+Qt6.5.2)



  • I am trying and tryin to define a QCamera Variable in my Code, but always comes an exception or this error:
    Qt3BotonCalibrar.obj : error LNK2019: símbolo externo "__declspec(dllimport) public: virtual __cdecl QCamera::~QCamera(void)" (_imp??1QCamera@@UEAA@XZ)
    This is happening everytime I write in my MainWIndow.h "QCamera *camarita = new QCamera;"

    #pragma once

    #include <QtWidgets/QMainWindow>
    #include <QPainter>
    #include "ui_Qt3BotonCalibrar.h"
    #include "ui_WidgetForm_V2.h" //<---V2---- Incluir su librería
    #include "ui_WidgetForm_V3.h" //<---V2---- Incluir su librería

    #include <QtCore> //Para el timer

    #include <iostream> //para los int del tamaño de la pantalla
    #include <Windows.h> //para los int del tamaño de la pantalla

    #include <QtMultimedia/QCamera>
    //#include <QCamera>
    //#include <QtMultimediaWidgets/QCameraViewfinder>
    #include "qcamera.h"
    //#include "QtMultimedia/qcamera.h"
    //#include "QtMultimedia/QCameraInfo.h"

    class Qt3BotonCalibrar : public QMainWindow
    {
    Q_OBJECT

    public:
    Qt3BotonCalibrar(QWidget *parent = Q_NULLPTR);
    void paintEvent(QPaintEvent *event);
    QTimer reloj;
    static int contador;
    QCamera camarita = new QCamera;// ("/dev/video0");
    //QCameraViewfinder
    viewfinder = new QCameraViewfinder;
    //camarita->setViewfinder(viewfinder);

    It seems to be a problem with libreria or includes, but I have already tried to add <QCamera>, and also added "$(QTDIR)\include;$(QTDIR)\include\QtMultimedia;" in Proyect-Properties in Visual Studio, but no way...
    I have checked and the Files are in those folders, but still not working and I am running out of ideas.
    Could you please help me?


  • Qt Champions 2016

    @Ammie said in QCamera error LNK1120 (with Visual Studio+Qt6.5.2):

    QCamera

    You need to add
    QT += multimedia
    to your .pro file.

    alt text


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.