trubble with Static Qt5.6.0 with -qt-sql-psql compiling from source



  • Hello.
    I'm not a pro.
    I need to build the project into a single static binary.
    The problem is that the program must connect to postgresql database in the network, and postgres is not installed on the client.
    After longtime googling, i came to the conclusion that i need a static assembly driver postgress included in Qtsql module
    For assembly use:

    • Qt-opensource-windows-x86-mingw492-5.6.0
    • PostgreSQL 9.3 (x86)
    • Configing:
      configure -static -platform win32-g ++ -prefix "C: \ Qt \ Qt5.6.0_Static_psql_odbc" -I "C:\psql\include" -release -opensource -confirm-license -nomake examples -nomake tests -nomake tools -opengl desktop -no-angle -qt-sql- psql -qt-sql-odbc -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype

    Configuration takes place without errors.
    At compile time I get a lot of errors in token.h file ...

    ....
    g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++1y -fno-exceptions -frtti -W
    all -Wextra -DUNICODE -DQT_MOC -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARR
    AY -DQT_NO_COMPRESS -DQT_USE_QSTRINGBUILDER -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQ
    T_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_N
    O_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE
    -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED
    -DQT_NO_TRANSLATION -I. -IC:\pgsql\include -I. -I......\include -I......\in
    clude\QtCore -I......\include\QtCore\5.6.0 -I......\include\QtCore\5.6.0\QtC
    ore -I......\include\QtXml -I......\include\QtXml\5.6.0 -I......\include\Q
    tXml\5.6.0\QtXml -I......\mkspecs\win32-g++ -o .obj\release\moc.o moc.cpp
    In file included from symbols.h:38:0,
    from parser.h:38,
    from moc.h:37,
    from moc.cpp:34:
    token.h:70:7: error: expected identifier before 'void'
    F(THIS)
    ^
    token.h:218:33: note: in definition of macro 'CREATE_ENUM_VALUE'
    #define CREATE_ENUM_VALUE(Name) Name,
    ^
    token.h:219:5: note: in expansion of macro 'FOR_ALL_TOKENS'
    FOR_ALL_TOKENS(CREATE_ENUM_VALUE)
    ^
    token.h:70:7: error: expected '}' before 'void'
    F(THIS)
    ^
    token.h:218:33: note: in definition of macro 'CREATE_ENUM_VALUE'
    #define CREATE_ENUM_VALUE(Name) Name,
    ^
    token.h:219:5: note: in expansion of macro 'FOR_ALL_TOKENS'
    FOR_ALL_TOKENS(CREATE_ENUM_VALUE)
    ^
    token.h:218:37: error: expected unqualified-id before ',' token
    #define CREATE_ENUM_VALUE(Name) Name,
    ^
    token.h:70:5: note: in expansion of macro 'CREATE_ENUM_VALUE'
    F(THIS)
    ^
    ......................................................................................................................
    token.h:95:7: error: two or more data types in declaration of 'STATIC'
    F(STATIC)
    ^
    token.h:218:33: note: in definition of macro 'CREATE_ENUM_VALUE'
    #define CREATE_ENUM_VALUE(Name) Name,
    ^
    token.h:219:5: note: in expansion of macro 'FOR_ALL_TOKENS'
    FOR_ALL_TOKENS(CREATE_ENUM_VALUE)
    ^
    token.h:96:7: error: expected unqualified-id before 'const'
    F(CONST)
    ^
    token.h:218:33: note: in definition of macro 'CREATE_ENUM_VALUE'
    #define CREATE_ENUM_VALUE(Name) Name,
    ^
    token.h:219:5: note: in expansion of macro 'FOR_ALL_TOKENS'
    FOR_ALL_TOKENS(CREATE_ENUM_VALUE)
    ^
    token.h:265:1: error: expected declaration before '}' token
    };
    ^
    Makefile.Release:302: recipe for target '.obj/release/moc.o' failed
    mingw32-make[4]: *** [.obj/release/moc.o] Error 1
    mingw32-make[4]: Leaving directory 'C:/Qt/Qt5.6.0/5.6/Src/qtbase/src/tools/moc'
    Makefile:34: recipe for target 'release' failed
    mingw32-make[3]: *** [release] Error 2
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.6.0/5.6/Src/qtbase/src/tools/moc'
    Makefile:114: recipe for target 'sub-moc-make_first' failed
    mingw32-make[2]: *** [sub-moc-make_first] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.6.0/5.6/Src/qtbase/src'
    Makefile:41: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: *** [sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.6.0/5.6/Src/qtbase'
    makefile:67: recipe for target 'module-qtbase-make_first' failed
    mingw32-make: *** [module-qtbase-make_first] Error 2

    C:\Qt\Qt5.6.0\5.6\Src>

    Please help deal with the problem.
    Ways to Postgre are registered in the PATH
    Sorry for alot of letters.



  • Tried on 3 win-platforms - same result. Help please. :(


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What platforms did you try exactly ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.