Make GTQTC automatically Linux OS.

137 views
Skip to first unread message

Itamar Lins

unread,
Feb 25, 2026, 8:46:17 AMFeb 25
to Harbour Users
Hi!
I'm trying to run an example using GTQTC but without success on Linux.

$ hbmk2 gtqtc.hbp
hbmk2[gtqtc]: plugin: HB_QTPATH, HB_QTSUFFIX not set, could not autodetect
'moc' executable

I put:       export HB_WITH_QT=/usr/include/x86_64-linux-gnu/qt6
And make and make install... 
...
qt6-base-dev is already the newest version (6.9.2+dfsg-1ubuntu1)
Any advice on how to proceed?

Best regards,
Itamar M. Lins Jr.

Itamar Lins

unread,
Feb 25, 2026, 2:36:49 PMFeb 25
to Harbour Users
Hi!
Any fix script gtqtc.hbp
It look for moc-qt6 but the name of file is only moc.

$ pkg -L qt6-base-dev-tools | grep moc
/usr/lib/qt6/libexec/cmake_automoc_parser
/usr/lib/qt6/libexec/moc

hbmk2[gtqtc]: plugin: HB_QTPATH, HB_QTSUFFIX not set, could not autodetect 'moc-qt6' executable

Best regards,
Itamar M. Lins Jr.

Itamar Lins

unread,
Feb 25, 2026, 2:57:17 PMFeb 25
to Harbour Users
Hi!
I clean -> export HB_QTSUFFIX=
Now i get many warings and  erros.
...
usr/include/x86_64-linux-gnu/qt6/QtCore/qendian.h:131:18: error: no matching function for call to ‘qbswap(long long unsigned int&)
 131 |     temp = qbswap(temp);
     |            ~~~~~~^~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qendian.h:131:18: note: there is 1 candidate
/usr/include/x86_64-linux-gnu/qt6/QtCore/qendian.h:103:20: note: candidate 1: ‘template<class T, class> constexpr T qbswap(T)’
 103 | inline constexpr T qbswap(T source)
     |                    ^~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qendian.h:103:20: note: template argument deduction/substitution failed:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qflags.h: In instantiation of ‘constexpr bool operator==(QFlags<Qt::ImageConversionFlag>, QFlags<Qt::ImageConver
sionFlag>)’:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qflags.h:183:18:   required from ‘constexpr bool operator==(QFlags<Qt::ImageConversionFlag>, Qt::ImageConversion
Flag)’
 183 |     { return lhs == QFlags(rhs); }
     |              ~~~~^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtGui/qpainter.h:811:61:   required from here
 811 |     if (sx == 0 && sy == 0 && sw == -1 && sh == -1 && flags == Qt::AutoColor)
     |                                                       ~~~~~~^~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qflags.h:179:18: error: class QFlags<Qt::ImageConversionFlag>’ has no member named ‘i
 179 |     { return lhs.i == rhs.i; }
     |              ~~~~^
/usr/include/x86_64-linux-gnu/qt6/QtCore/qflags.h:179:27: error: class QFlags<Qt::ImageConversionFlag>’ has no member named ‘i
 179 |     { return lhs.i == rhs.i; }
     |                       ~~~~^
hbmk2[gtqtc]: Erro: Executando compilador C/C++. 1
g++ -c -O3 -std=c++17 -DHBMK_HAS_QT5 -std=c++17 -W -Wall -pipe -fPIC -I/usr/local/include/harbour -I'/usr/include/x86_64-linux-gnu/qt6' -std=c++11 ../../
../gtqtc1.cpp '../../../.hbmk/linux/gcc/moc_gtqtc.cpp'

etc...
Second IA QT6 is c++17 and c++11 conflict...

Itamar Lins

unread,
Feb 26, 2026, 12:27:55 PMFeb 26
to Harbour Users
Hi!

With the help of AI and reading here and there, and modifying the hbmk2.prg file to get GCC 15.2.0
I managed to compile.

harbour/contrib/gtqtchbmk2 gtqtc.hbp -cpp=iso17
hbmk2: Dependência 'qt5' encontrado: /usr/include/x86_64-linux-gnu/qt6
hbmk2: Compilando C++...
hbmk2: Criando biblioteca estáticas... libgtqtc.a

itamar@itamar-pc:~/dev/harbour/contrib/gtqtc$ gcc -v
...
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (Ubuntu 15.2.0-4ubuntu4)

Best regards,
Itamar M. Lins Jr.

Itamar Lins

unread,
Feb 26, 2026, 12:49:03 PMFeb 26
to Harbour Users
Hi!
~/fontes/testes$ hbmk2 gttst.prg -gtqtc -lstdc++ -lQt6Widgets -lQt6Gui -lQt6Core

Captura de imagem_20260226_144515.png
#include "inkey.ch"
#include "hbgtinfo.ch"
ANNOUNCE HB_GT_SYS
REQUEST HB_GT_QTC_DEFAULT
//REQUEST HB_GT_XWC_DEFAULT

Function main

// get font size and width from system file
hb_gtInfo( HB_GTI_FONTSIZE, 30 )
hb_gtInfo( HB_GTI_FONTWIDTH, 15 )

hb_gtInfo( HB_GTI_WINTITLE, "TEST" )
hb_gtInfo( HB_GTI_ICONFILE, "test.ico" )
hb_gtInfo( HB_GTI_FONTNAME, "Monospace Regular" )

hb_gtInfo( HB_GTI_SELECTCOPY, .T. )
hb_gtInfo( HB_GTI_CLOSABLE, .T. )
hb_gtInfo( HB_GTI_RESIZABLE, .F. )

hb_gtInfo( HB_GTI_CODEPAGE, 255 )
hb_gtInfo( HB_GTI_ALTENTER, .T. )
hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_FONT )

hb_gtInfo( HB_GTI_SELECTCOPY, .T. )
hb_gtInfo( HB_GTI_CLOSABLE, .T. )
hb_gtInfo( HB_GTI_RESIZABLE, .T. )
hb_gtInfo( HB_GTI_CODEPAGE, 255 )
hb_gtInfo( HB_GTI_ALTENTER, .T. )
//hb_gtInfo( HB_GTI_FONTWEIGHT, HB_GTI_FONTW_NORMAL )
hb_gtInfo( HB_GTI_FONTWEIGHT, HB_GTI_FONTW_THIN )

SetMode( 23, 50 )
set color to "6+/1,4/3"
clear

@ 1,1 to 20,48
@ 2,2 say "--------------top of window------------------"
@ 11,2 say "-----------middle of window------------------"
@ 19,2 say "----------bottom of window------------------"
@ 21,1

wait
Reply all
Reply to author
Forward
0 new messages