Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62307

'was not declared in this scope' and 'undeclared identifier' errors for builds with OpenSSL-1.1.0 on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P5: Not important
    • None
    • 5.9
    • Network: SSL
    • None
    •  * Windows 10 x64,
       * mingw-w64 x86_64 6.3.0,
       * MSVC 2015 Update 3,
       * Windows SDK 10.0.14393.33,
       * OpenSSL-1.1.0f.

    Description

      Hello everyone,

      Got errors for builds with OpenSSL-1.1.0f using mingw-w64:

      c:\libQT-5.9-dev\build\qtbase\bin\moc.exe -DUNICODE -D_UNICODE -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DQT_USE_SYSTEM_PROXIES -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_NETWORK_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_CORE_LIB --include .moc/release/moc_predefs.h -Ic:/libQT-5.9-dev/build/qtbase/mkspecs/win32-g++ -Ic:/libQT-5.9-dev/build/qtbase/src/network -Ic:/libQT-5.9-dev/build/qtbase/src/network/kernel -Ic:/libQT-5.9-dev/build/qtbase/include -Ic:/libQT-5.9-dev/build/qtbase/include/QtNetwork -Ic:/libQT-5.9-dev/build/qtbase/include/QtNetwork/5.9.2 -Ic:/libQT-5.9-dev/build/qtbase/include/QtNetwork/5.9.2/QtNetwork -Ic:/libQT-5.9-dev/build/qtbase/src/network/tmp -Ic:/libQT-5.9-dev/build/qtbase/include/QtCore/5.9.2 -Ic:/libQT-5.9-dev/build/qtbase/include/QtCore/5.9.2/QtCore -Ic:/libQT-5.9-dev/build/qtbase/include/QtCore -IC:/ProgramData/Mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++ -IC:/ProgramData/Mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/x86_64-w64-mingw32 -IC:/ProgramData/Mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/backward -IC:/ProgramData/Mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include -IC:/ProgramData/Mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include-fixed -IC:/ProgramData/Mingw64/x86_64-w64-mingw32/include access\qnetworkaccessdebugpipebackend_p.h -o .moc\release\moc_qnetworkaccessdebugpipebackend_p.cpp
      cd widgets\ && ( if not exist Makefile c:\libQT-5.9-dev\build\qtbase\bin\qmake.exe -o Makefile c:\libQT-5.9-dev\build\qtbase\src\widgets\widgets.pro ) && mingw32-make -f Makefile
      access\qnetworkaccessdebugpipebackend_p.h:0: Note: No relevant classes found. No output generated.
      cd platformsupport\ && ( if not exist Makefile c:\libQT-5.9-dev\build\qtbase\bin\qmake.exe -o Makefile c:\libQT-5.9-dev\build\qtbase\src\platformsupport\platformsupport.pro ) && mingw32-make -f Makefile
      mingw32-make[3]: Entering directory 'c:/libQT-5.9-dev/build/qtbase/src/widgets'
      mingw32-make -f Makefile.Release
      mingw32-make[3]: Entering directory 'c:/libQT-5.9-dev/build/qtbase/src/platformsupport'
      cd eventdispatchers\ && ( if not exist Makefile c:\libQT-5.9-dev\build\qtbase\bin\qmake.exe -o Makefile c:\libQT-5.9-dev\build\qtbase\src\platformsupport\eventdispatchers\eventdispatchers.pro ) && mingw32-make -f Makefile
      In file included from ssl\qsslsocket_openssl_symbols_p.h:71:0,
                       from ssl\qsslcertificate.cpp:116:
      ssl\qsslsocket_openssl_p.h:102:9: error: '_STACK' does not name a type
       typedef _STACK STACK;
               ^~~~~~
      In file included from ssl\qsslsocket_openssl_symbols_p.h:71:0,
                       from ssl\qssldiffiehellmanparameters_openssl.cpp:42:
      ssl\qsslsocket_openssl_p.h:102:9: error: '_STACK' does not name a type
       typedef _STACK STACK;
               ^~~~~~
      In file included from ssl\qsslcertificate.cpp:116:0:
      ssl\qsslsocket_openssl_symbols_p.h:329:14: error: 'STACK' was not declared in this scope
       int q_sk_num(STACK *a);
                    ^~~~~
      ssl\qsslsocket_openssl_symbols_p.h:329:21: error: 'a' was not declared in this scope
       int q_sk_num(STACK *a);
                           ^
      ssl\qsslsocket_openssl_symbols_p.h:330:20: error: variable or field 'q_sk_pop_free' declared void
       void q_sk_pop_free(STACK *a, void (*b)(void *));
                          ^~~~~
      
      <snip>
      
      ssl\qsslsocket_openssl_symbols.cpp:446:1: note: in expansion of macro 'DEFINEFUNC2'
       DEFINEFUNC2(int, i2d_DHparams, DH *a, a, unsigned char **p, p, return -1, return)
       ^
      ssl\qsslsocket_openssl_symbols.cpp: In function 'int q_DH_check(DH*, int*)':
      ssl\qsslsocket_openssl_symbols_p.h:188:49: error: 'DH_check' was not declared in this scope
           ret q_##func(arg1, arg2) { funcret func(a, b); }
                                                       ^
      ssl\qsslsocket_openssl_symbols.cpp:447:1: note: in expansion of macro 'DEFINEFUNC2'
       DEFINEFUNC2(int, DH_check, DH *dh, dh, int *codes, codes, return 0, return)
       ^
      Makefile.Release:25581: recipe for target '.obj/release/qsslsocket_openssl.o' failed
      mingw32-make[4]: *** [.obj/release/qsslsocket_openssl.o] Error 1
      Makefile.Release:25847: recipe for target '.obj/release/qsslsocket_openssl_symbols.o' failed
      mingw32-make[4]: *** [.obj/release/qsslsocket_openssl_symbols.o] Error 1
      mingw32-make[4]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase/src/network'
      Makefile:36: recipe for target 'release' failed
      mingw32-make[3]: *** [release] Error 2
      mingw32-make[3]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase/src/network'
      Makefile:271: recipe for target 'sub-network-make_first' failed
      mingw32-make[2]: *** [sub-network-make_first] Error 2
      mingw32-make[2]: *** Waiting for unfinished jobs....
      mingw32-make[4]: Entering directory 'c:/libQT-5.9-dev/build/qtbase/src/widgets'
      mingw32-make[4]: Nothing to be done for 'first'.
      
      <snip>
      
      mingw32-make[5]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase/src/platformsupport/fontdatabases'
      mingw32-make[4]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase/src/platformsupport/fontdatabases'
      mingw32-make[3]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase/src/platformsupport'
      mingw32-make[2]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase/src'
      Makefile:44: recipe for target 'sub-src-make_first' failed
      mingw32-make[1]: *** [sub-src-make_first] Error 2
      mingw32-make[1]: Leaving directory 'c:/libQT-5.9-dev/build/qtbase'
      Makefile:78: recipe for target 'module-qtbase-make_first' failed
      mingw32-make: *** [module-qtbase-make_first] Error 2

       

      and MSVC:

              cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -utf-8 -D_HAS_EXCEPTIONS=0 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DQT_USE_SYSTEM_PROXIES -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_NETWORK_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -D_WINDLL -I. -Ikernel -I..\..\include -I..\..\include\QtNetwork -I..\..\include\QtNetwork\5.9.2 -I..\..\include\QtNetwork\5.9.2\QtNetwork -Itmp -I..\..\include\QtCore\5.9.2 -I..\..\include\QtCore\5.9.2\QtCore -I..\..\include\QtCore -I.moc\release -Ic:\libZLIB-1.2.11\MSVC64RH\include -Ic:\libOPENSSL-1.1.0f\MSVC64RH\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\test\AppData\Local\Temp\nm2E00.tmp
      qsslcertificate.cpp
      c:\libQT-5.9-dev\build\qtbase\src\network\ssl\qsslsocket_openssl_p.h(102): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      c:\libQT-5.9-dev\build\qtbase\src\network\ssl\qsslsocket_openssl_p.h(102): error C2146: syntax error: missing ';' before identifier 'STACK'
      c:\libQT-5.9-dev\build\qtbase\src\network\ssl\qsslsocket_openssl_symbols_p.h(329): error C2065: 'a': undeclared identifier
      
      <snip>
      
      ssl\qsslsocket_openssl_symbols.cpp(446): error C3861: 'i2d_DHparams': identifier not found
      ssl\qsslsocket_openssl_symbols.cpp(447): error C3861: 'DH_check': identifier not found
      Generating Code...
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.

       

      Reproduced for:

      • builds using
      -openssl-linked OPENSSL_LIBS="-llibcrypto -llibssl" OPENSSL_PREFIX="%CD%\..\..\libOPENSSL-1.1.0f\MSVC64RH"

      OR

      -openssl-linked OPENSSL_LIBS="-llibcrypto -llibssl" -I "%CD%\..\..\libOPENSSL-1.1.0f\MSVC64RH\include" -L "%CD%\..\..\libOPENSSL-1.1.0f\MSVC64RH\lib"

      configuration keys.

       

      Not reproduced for:

      • builds using OpenSSL-1.0.2g.

       

      Alexander

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            sav sav
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes