Undefined reference to Magick::Image::Image() - qt

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
albrechtmyers
Posts: 1
Joined: 2020-01-27T20:43:51-07:00
Authentication code: 1152

Undefined reference to Magick::Image::Image() - qt

Post by albrechtmyers »

error in qt. I connected Magick ++ through Add Library -> Add External Library.

.pro

Code: Select all

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = Filters_3
TEMPLATE = app

CONFIG += c++11

SOURCES += \
        main.cpp \
        mainwindow.cpp

HEADERS += \
        mainwindow.h

FORMS += \
        mainwindow.ui

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

win32: LIBS += -L$$PWD/ImageMagick-6.9.9-Q16-HDRI/lib/ -lCORE_RL_Magick++_

INCLUDEPATH += $$PWD/ImageMagick-6.9.9-Q16-HDRI/include
DEPENDPATH += $$PWD/ImageMagick-6.9.9-Q16-HDRI/include


win32:CONFIG(release, debug|release): LIBS += -L$$PWD/ImageMagick-6.9.9-Q16-HDRI/lib/ -lCORE_RL_magick_
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/ImageMagick-6.9.9-Q16-HDRI/lib/ -lCORE_RL_magick_
else:unix:!macx: LIBS += -L$$PWD/ImageMagick-6.9.9-Q16-HDRI/lib/ -lCORE_RL_magick_

INCLUDEPATH += $$PWD/ImageMagick-6.9.9-Q16-HDRI/include
DEPENDPATH += $$PWD/ImageMagick-6.9.9-Q16-HDRI/include
mainwindow.cpp

Code: Select all

  #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFont>
#include<QString>
#include<QLabel>
#include<QFileDialog>
#include "Magick++.h"

using namespace std;
using namespace Magick;


MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_load_clicked()
{
    QString filePath = QFileDialog::getOpenFileName(this, tr("Open Image"), QDir::homePath(), tr("Image Files (*.png *.jpg *.bmp)"));
    //ui->label->setPixmap(QPixmap(filePath).scaled(ui->label->size()));
    string patx`h = filePath.toStdString();

        Image image(path);
        image.blur(0.5, 0.7);
        ui->label->setPixmap(QPixmap(filePath).scaled(ui->label->size()));
}
https://4kpornindex.com/
Last edited by albrechtmyers on 2020-02-20T02:11:57-07:00, edited 1 time in total.
;)

User avatar
fmw42
Posts: 26268
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Undefined reference to Magick::Image::Image() - qt

Post by fmw42 »

How about telling us what version of ImageMagick and on what platform/OS?

Post Reply