Skip to content

Instantly share code, notes, and snippets.

@haxscramper
Last active February 2, 2019 15:19
Show Gist options
  • Save haxscramper/3c51682079db780fb64e2d653d034dbb to your computer and use it in GitHub Desktop.
Save haxscramper/3c51682079db780fb64e2d653d034dbb to your computer and use it in GitHub Desktop.
How to build qt + graphicsmagick + boost on windows/linux
  • Install qt

To build on debian you need to execute

sudo apt-get install qt5-default git curl make g++ libboost-dev libgraphicsmagick-dev graphicsmagick-libmagick-dev-compat
qmake with-magick.pro
make

Done

#include <iostream>
#include <QString>
#include <boost/property_tree/ptree.hpp>
#include <QApplication>
int main(int argc, char** argv) {
QApplication app(argc, argv);
QString qstr = "Hello world\n";
std::cout << qstr.toStdString();
return 0;
}
unix {
QMAKE_CXXFLAGS += -std=c++17
}
win32 {
INCLUDEPATH *= C:\boost
}
QT *= xml widgets core gui
TEMPLATE = app
SOURCES = no-magick.cpp
  • Install qt creator
#include <iostream>
#include <QString>
#include <boost/property_tree/ptree.hpp>
#include <QApplication>
#include <Magick++.h>
int main(int argc, char** argv) {
Magick::InitializeMagick(*argv);
QApplication app(argc, argv);
QString qstr = "Hello world\n";
std::cout << qstr.toStdString();
Magick::Image image;
return 0;
}
unix {
QMAKE_CXXFLAGS += -std=c++17
QT *= webenginewidgets
}
win32 {
QT *= webengine
INCLUDEPATH *= C:\boost
}
QT *= xml widgets core gui
TEMPLATE = app
SOURCES = with-magick.cpp
INCLUDEPATH += /usr/include/GraphicsMagick
LIBS += \
-L/usr/lib \
-lGraphicsMagick++ \
-lGraphicsMagick \
-llcms2 \
-lfreetype \
-lXext \
-lSM \
-lICE \
-lX11 \
-llzma \
-lbz2 \
-lz \
-lltdl \
-lm \
-lgomp \
-lpthread \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment