Estou seguindo os passos que o Pritpal informou no grupo do hbqt aqui https://groups.google.com/forum/#!topic/qtcontribs/a90JXbXoX3I, porém lá ele não chega a explicar tudo, e estou no seguinte ponto:
Crio a lib com o hbmk2, e ela está incluida no projeto no qtcreator onde tento gerar o apk. Meu código está assim:
main.prg
#include "hbqtgui.ch"
FUNCTION Main()
Msg( "Teste" )
QApplication():exec()
RETURN NIL
STATIC PROCEDURE Msg(cMsg, cTitle)
LOCAL oMB
IF cTitle == NIL
cTitle := "Aviso"
ENDIF
oMB := QMessageBox()
oMB:setInformativeText( cMsg )
oMB:setWindowTitle( cTitle )
oMB:exec()
oMB:setParent( QWidget() )
RETURN
Gero a lib, mas quando compilo pelo qtcreator mas gera os erros:
hb-gui.obj(.text.HB_FUN_request_MAIN+0x0): error: undefined reference to 'HB_FUN_MAIN'
collect2.exe: error: ld returned 1 exit status
Makefile:78: recipe for target 'libtest.so' failed
mingw32-make: *** [libtest.so] Error 1
20:09:46: The process "C:\Qt\Qt5.3.0\Tools\mingw482_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project hb-gui (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.3.0))
When executing step 'Make'
arquivo hb-gui.pro
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
TARGET = lovice
TEMPLATE = app
SOURCES += hb-gui.cpp
HEADERS +=
FORMS +=
RESOURCES +=
CONFIG += mobility
MOBILITY =
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
OTHER_FILES += $$PWD/android/AndroidManifest.xml
INCLUDEPATH += C:/hb32-qt/include/
LIBS += -LC:\hb32-qt\lib\android\gccarm \
\
-ltest \
\
-Wl,--start-group \
-lexpat \
-lgtpca \
-lgtstd \
-lgttrm \
-lhbcomm \
-lhbcommon \
-lhbcpage \
-lhbcplr \
-lhbct \
-lhbdebug \
-lhbexpat \
-lhbextern \
-lhbformat \
-lhbfship \
-lhbgt \
-lhblang \
-lhblzf \
-lhbmacro \
-lhbmemio \
-lhbmisc \
-lhbmlzo \
-lhbmxml \
-lhbmzip \
-lhbnetio \
-lhbnf \
-lhbnulrdd \
-lhboslib \
-lhbpcre \
-lhbpp \
-lhbrdd \
-lhbrtl \
-lhbtest \
-lhbtip \
-lhbuddall \
-lhbunix \
-lhbusrrdd \
-lhbvm \
-lhbziparc \
-lhbzlib \
-llzf \
-lminilzo \
-lminizip \
-lmxml \
-lrddbm \
-lrddcdx \
-lrddfpt \
-lrddnsx \
-lrddntx \
-lrddsql \
-lgtqtc \
\
-lhbqtcore \
-lhbqtgui \
-lhbqtnetwork \
-lhbqtwidgets \
\
-Wl,--end-group
Ele não acha a funcao main, mas a libtest.a está no diretório das libs, não encontro o problema