I am sorry, I did not point out that I chose to use C++11 and hence ones
needs Qt5 (which understands "CONFIG += c++11" and will adjust the
compiler options) to build this without modifications. I just uploaded
an updated version that modifies the compiler flags directly. Please
retry and sorry for the inconvenience.
Best regards, Adam.
Am 20.10.2014 um 01:58 schrieb Martin Spacek:
> Adam, I tried building your example, but I get this compile error on
> make. This is in Xubuntu 14.04 amd64:
>
> mspacek@Escher:~/Desktop/tile-artefact$ qmake
> mspacek@Escher:~/Desktop/tile-artefact$ make
> g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/poppler/qt4 -I/usr/include/poppler -I. -o tile-artefact.o tile-artefact.cpp
> tile-artefact.cpp:39:5: warning: identifier ‘constexpr’ is a keyword in C++11 [-Wc++0x-compat]
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp: In function ‘int main(int, char**)’:
> tile-artefact.cpp:23:47: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
> const QScopedPointer< Poppler::Document > document{ Poppler::Document::load(arguments.at(1)) };
> ^
> tile-artefact.cpp:23:98: error: in C++98 ‘document’ must be initialized by constructor, not by ‘{...}’
> const QScopedPointer< Poppler::Document > document{ Poppler::Document::load(arguments.at(1)) };
> ^
> tile-artefact.cpp:31:43: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
> const QScopedPointer< Poppler::Page > page{ document->page(0) };
> ^
> tile-artefact.cpp:31:67: error: in C++98 ‘page’ must be initialized by constructor, not by ‘{...}’
> const QScopedPointer< Poppler::Page > page{ document->page(0) };
> ^
> tile-artefact.cpp:39:5: error: ‘constexpr’ was not declared in this scope
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp:39:15: error: expected ‘;’ before ‘auto’
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp:40:15: error: expected ‘;’ before ‘auto’
> constexpr auto x = 0, y = 531;
> ^
> tile-artefact.cpp:41:15: error: expected ‘;’ before ‘auto’
> constexpr auto w = 410, h = 530;
> ^
> tile-artefact.cpp:44:5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
> auto image = page->renderToImage(r, r, -1, -1, -1, -1);
> ^
> tile-artefact.cpp:44:10: error: ‘image’ does not name a type
> auto image = page->renderToImage(r, r, -1, -1, -1, -1);
> ^
> tile-artefact.cpp:46:5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
> auto label = new QLabel();
> ^
> tile-artefact.cpp:46:10: error: ‘label’ does not name a type
> auto label = new QLabel();
> ^
> tile-artefact.cpp:47:5: error: ‘label’ was not declared in this scope
> label->setWindowTitle("Full page");
> ^
> tile-artefact.cpp:48:41: error: ‘image’ was not declared in this scope
> label->setPixmap(QPixmap::fromImage(image));
> ^
> tile-artefact.cpp:54:33: error: ‘r’ was not declared in this scope
> image = page->renderToImage(r, r, x, y, w, h);
> ^
> tile-artefact.cpp:54:39: error: ‘x’ was not declared in this scope
> image = page->renderToImage(r, r, x, y, w, h);
> ^
> tile-artefact.cpp:54:42: error: ‘y’ was not declared in this scope
> image = page->renderToImage(r, r, x, y, w, h);
> ^
> tile-artefact.cpp:54:45: error: ‘w’ was not declared in this scope
> image = page->renderToImage(r, r, x, y, w, h);
> ^
> tile-artefact.cpp:54:48: error: ‘h’ was not declared in this scope
> image = page->renderToImage(r, r, x, y, w, h);
> ^
> make: *** [tile-artefact.o] Error 1
>
Hello,
I am sorry, I did not point out that I chose to use C++11 and hence ones
needs Qt5 (which understands "CONFIG += c++11" and will adjust the
compiler options) to build this without modifications. I just uploaded
an updated version that modifies the compiler flags directly. Please
retry and sorry for the inconvenience.
Best regards, Adam.
Am 20.10.2014 um 01:58 schrieb Martin Spacek: Escher: ~/Desktop/ tile-artefact$ qmake Escher: ~/Desktop/ tile-artefact$ make share/qt4/ mkspecs/ linux-g+ +-64 -I. -I/usr/ include/ qt4/QtCore -I/usr/ include/ qt4/QtGui -I/usr/include/qt4 -I/usr/ include/ poppler/ qt4 -I/usr/ include/ poppler -I. -o tile-artefact.o tile-artefact.cpp cpp:39: 5: warning: identifier ‘constexpr’ is a keyword in C++11 [-Wc++0x-compat] cpp:23: 47: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default] :Document: :load(arguments .at(1)) }; cpp:23: 98: error: in C++98 ‘document’ must be initialized by constructor, not by ‘{...}’ :Document: :load(arguments .at(1)) }; cpp:31: 43: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default] cpp:31: 67: error: in C++98 ‘page’ must be initialized by constructor, not by ‘{...}’ cpp:39: 5: error: ‘constexpr’ was not declared in this scope cpp:39: 15: error: expected ‘;’ before ‘auto’ cpp:40: 15: error: expected ‘;’ before ‘auto’ cpp:41: 15: error: expected ‘;’ before ‘auto’ cpp:44: 5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat] mage(r, r, -1, -1, -1, -1); cpp:44: 10: error: ‘image’ does not name a type mage(r, r, -1, -1, -1, -1); cpp:46: 5: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat] cpp:46: 10: error: ‘label’ does not name a type cpp:47: 5: error: ‘label’ was not declared in this scope setWindowTitle( "Full page"); cpp:48: 41: error: ‘image’ was not declared in this scope setPixmap( QPixmap: :fromImage( image)) ; cpp:54: 33: error: ‘r’ was not declared in this scope mage(r, r, x, y, w, h); cpp:54: 39: error: ‘x’ was not declared in this scope mage(r, r, x, y, w, h); cpp:54: 42: error: ‘y’ was not declared in this scope mage(r, r, x, y, w, h); cpp:54: 45: error: ‘w’ was not declared in this scope mage(r, r, x, y, w, h); cpp:54: 48: error: ‘h’ was not declared in this scope mage(r, r, x, y, w, h);
> Adam, I tried building your example, but I get this compile error on
> make. This is in Xubuntu 14.04 amd64:
>
> mspacek@
> mspacek@
> g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/
> tile-artefact.
> constexpr auto r = 96.47;
> ^
> tile-artefact.cpp: In function ‘int main(int, char**)’:
> tile-artefact.
> const QScopedPointer< Poppler::Document > document{ Poppler:
> ^
> tile-artefact.
> const QScopedPointer< Poppler::Document > document{ Poppler:
> ^
> tile-artefact.
> const QScopedPointer< Poppler::Page > page{ document->page(0) };
> ^
> tile-artefact.
> const QScopedPointer< Poppler::Page > page{ document->page(0) };
> ^
> tile-artefact.
> constexpr auto r = 96.47;
> ^
> tile-artefact.
> constexpr auto r = 96.47;
> ^
> tile-artefact.
> constexpr auto x = 0, y = 531;
> ^
> tile-artefact.
> constexpr auto w = 410, h = 530;
> ^
> tile-artefact.
> auto image = page->renderToI
> ^
> tile-artefact.
> auto image = page->renderToI
> ^
> tile-artefact.
> auto label = new QLabel();
> ^
> tile-artefact.
> auto label = new QLabel();
> ^
> tile-artefact.
> label->
> ^
> tile-artefact.
> label->
> ^
> tile-artefact.
> image = page->renderToI
> ^
> tile-artefact.
> image = page->renderToI
> ^
> tile-artefact.
> image = page->renderToI
> ^
> tile-artefact.
> image = page->renderToI
> ^
> tile-artefact.
> image = page->renderToI
> ^
> make: *** [tile-artefact.o] Error 1
>