跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. Qt Development
  3. QML and Qt Quick
  4. Why Qt creator say "use of undeclared identifier 'QSslSocket'", but it exists.
Forum Updated to NodeBB v4.3 + New Features

Why Qt creator say "use of undeclared identifier 'QSslSocket'", but it exists.

已排程 已置頂 已鎖定 已移動 Unsolved QML and Qt Quick
28 貼文 4 Posters 7.5k 瀏覽 2 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • SGaistS 離線
    SGaistS 離線
    SGaist
    Lifetime Qt Champion
    寫於 最後由 編輯
    #10

    You have the complete list of option if you call configure --help.

    You should also check the configure summary to see what options/features are enabled.

    And finally, if you want to build for Android with OpenSSL, you need an Android build of OpenSSL.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 條回覆 最後回覆
    1
    • S 離線
      S 離線
      senmx
      寫於 最後由 senmx 編輯
      #11

      ./configure --help
      ...
      -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
      -openssl-linked ...... Use OpenSSL and link to libssl [no]
      -openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]

      I have now turned on this option and recompile

        1 #!/bin/bash
        2 #https://doc.qt.io/qt-5/android-building.html
        3 #https://doc.qt.io/qt-5/ssl.html
        4 
        5 cd /home/sen/soft/qt-everywhere-src-5.15.1
        6 make clean
        7 OPENSSL_LIBS='-L/home/sen/github/c/openssl-1.1.1g -lssl -lcrypto' ./configure -xplatform android-clang -prefix /usr/local/Qt-5.15.1-android --disable-rpath -nomake tests -nomake examples -android-ndk $ANDROID_NDK_HOME -android-sdk $AND    ROID_SDK_HOME -no-warnings-are-errors -openssl-linked
        8 make -j12
        9 make install
      

      on configure:

      ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl' failed.
      
      jsulmJ 1 條回覆 最後回覆
      0
      • S senmx

        ./configure --help
        ...
        -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
        -openssl-linked ...... Use OpenSSL and link to libssl [no]
        -openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]

        I have now turned on this option and recompile

          1 #!/bin/bash
          2 #https://doc.qt.io/qt-5/android-building.html
          3 #https://doc.qt.io/qt-5/ssl.html
          4 
          5 cd /home/sen/soft/qt-everywhere-src-5.15.1
          6 make clean
          7 OPENSSL_LIBS='-L/home/sen/github/c/openssl-1.1.1g -lssl -lcrypto' ./configure -xplatform android-clang -prefix /usr/local/Qt-5.15.1-android --disable-rpath -nomake tests -nomake examples -android-ndk $ANDROID_NDK_HOME -android-sdk $AND    ROID_SDK_HOME -no-warnings-are-errors -openssl-linked
          8 make -j12
          9 make install
        

        on configure:

        ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl' failed.
        
        jsulmJ 離線
        jsulmJ 離線
        jsulm
        Lifetime Qt Champion
        寫於 最後由 編輯
        #12

        @senmx Is /home/sen/github/c/openssl-1.1.1g the Android build?
        Check the config.log file to see why exactly it failed.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 條回覆 最後回覆
        0
        • jsulmJ jsulm

          @senmx Is /home/sen/github/c/openssl-1.1.1g the Android build?
          Check the config.log file to see why exactly it failed.

          S 離線
          S 離線
          senmx
          寫於 最後由 編輯
          #13

          @jsulm config.log:
          https://drive.google.com/file/d/1lvrOXPgVWjvnfGV5U7TaMqPEJYh0leLF/view?usp=sharing

          jsulmJ 1 條回覆 最後回覆
          0
          • S senmx

            @jsulm config.log:
            https://drive.google.com/file/d/1lvrOXPgVWjvnfGV5U7TaMqPEJYh0leLF/view?usp=sharing

            jsulmJ 離線
            jsulmJ 離線
            jsulm
            Lifetime Qt Champion
            寫於 最後由 編輯
            #14

            @senmx You did not answer my question.

            Did you check the config.log by yourself first?
            Because if you check it you see

            > main.cpp:2:10: fatal error: 'openssl/ssl.h' file not found
            > #include <openssl/ssl.h>
            

            So, it could not find SSL header.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 條回覆 最後回覆
            2
            • S 離線
              S 離線
              senmx
              寫於 最後由 senmx 編輯
              #15

              @jsulm
              I saw it, but I didn’t understand it. The first thing I saw from top to bottom was:

              > main.cpp:7:8: error: Intel CET not available
              > # error Intel CET not available
              > ^
              > 1 error generated.
              > make: *** [Makefile:191:main.o] 错误 1
              test config.qtbase.tests.intelcet FAILED
              

              Anyway, something is missing, I don’t know what is missing.

              Could not find openssl/ssl.h,but:

              [sen@x openssl]$ find /usr/include/openssl/ -type f -name "ssl.h"
              /usr/include/openssl/ssl.h
              

              I have compiled link library files in this directory:

              /home/sen/github/c/openssl-1.1.1g
              
              libssl_1_1.so
              libcrypto_1_1.so
              
              1 條回覆 最後回覆
              0
              • SGaistS 離線
                SGaistS 離線
                SGaist
                Lifetime Qt Champion
                寫於 最後由 編輯
                #16

                How did you build OpenSSL for Android ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 條回覆 最後回覆
                0
                • SGaistS SGaist

                  How did you build OpenSSL for Android ?

                  S 離線
                  S 離線
                  senmx
                  寫於 最後由 編輯
                  #17

                  @SGaist
                  according to Qt doc:

                  #!/bin/sh
                  
                  export HOST=linux-x86_64
                  export PATH="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST/bin":$PATH
                  
                  cd /home/sen/github/c/openssl-1.1.1g
                  ./Configure shared android-arm -D__ANDROID_API__=21
                  make -j12 SHLIB_VERSION_NUMBER= SHLIB_EXT=_1_1.so build_libs
                  
                  1 條回覆 最後回覆
                  0
                  • SGaistS 離線
                    SGaistS 離線
                    SGaist
                    Lifetime Qt Champion
                    寫於 最後由 編輯
                    #18

                    Then why are you mixing your system installation with your custom OpenSSL build.

                    By the way, your Intel CET is likely due to a line that starts with a #. My guess is that this is a comme but Python style rather than C/C++ style.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 條回覆 最後回覆
                    0
                    • SGaistS SGaist

                      Then why are you mixing your system installation with your custom OpenSSL build.

                      By the way, your Intel CET is likely due to a line that starts with a #. My guess is that this is a comme but Python style rather than C/C++ style.

                      S 離線
                      S 離線
                      senmx
                      寫於 最後由 senmx 編輯
                      #19

                      @SGaist The config.log above is the log of build qt-opensource, not openssl.Myself OpenSSL build is arm binding.

                      1 條回覆 最後回覆
                      0
                      • SGaistS 離線
                        SGaistS 離線
                        SGaist
                        Lifetime Qt Champion
                        寫於 最後由 編輯
                        #20

                        Can you provide the complete OpenSSL checks part ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        S 1 條回覆 最後回覆
                        0
                        • SGaistS SGaist

                          Can you provide the complete OpenSSL checks part ?

                          S 離線
                          S 離線
                          senmx
                          寫於 最後由 編輯
                          #21

                          @SGaist Do you mean "make check"? In order to check whether the two files libssl_1_1_1.so and libcrypto_1_1_1.so can be used? These two files can be correctly linked to the android project and using , should be no problem.

                          jsulmJ 1 條回覆 最後回覆
                          0
                          • S senmx

                            @SGaist Do you mean "make check"? In order to check whether the two files libssl_1_1_1.so and libcrypto_1_1_1.so can be used? These two files can be correctly linked to the android project and using , should be no problem.

                            jsulmJ 離線
                            jsulmJ 離線
                            jsulm
                            Lifetime Qt Champion
                            寫於 最後由 編輯
                            #22

                            @senmx said in Why Qt creator say "use of undeclared identifier 'QSslSocket'", but it exists.:

                            Do you mean "make check"?

                            No, the SSL check in config.log which is:

                            loaded result for library config.qtbase_network.libraries.openssl
                            Trying source 0 (type openssl) of library openssl ...
                            + cd /home/sen/soft/qt-everywhere-src-5.15.1/config.tests/openssl && /home/sen/soft/qt-everywhere-src-5.15.1/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" 'QMAKE_USE += openssl' 'QMAKE_LIBS_OPENSSL = -L/home/sen/github/c/openssl-1.1.1g -lssl -lcrypto' /home/sen/soft/qt-everywhere-src-5.15.1/config.tests/openssl
                            + cd /home/sen/soft/qt-everywhere-src-5.15.1/config.tests/openssl && MAKEFLAGS= /usr/bin/make
                            > /opt/android-sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -c -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -O2 -fPIC  -I. -I/home/sen/soft/qt-everywhere-src-5.15.1/qtbase/mkspecs/android-clang -o main.o main.cpp
                            > main.cpp:2:10: fatal error: 'openssl/ssl.h' file not found
                            > #include <openssl/ssl.h>
                            >          ^~~~~~~~~~~~~~~
                            > 1 error generated.
                            

                            @SGaist

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 條回覆 最後回覆
                            0
                            • SGaistS 離線
                              SGaistS 離線
                              SGaist
                              Lifetime Qt Champion
                              寫於 最後由 編輯
                              #23

                              From the looks of it, you did not provide the correct path to the where the includes are located.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              S 1 條回覆 最後回覆
                              0
                              • SGaistS SGaist

                                From the looks of it, you did not provide the correct path to the where the includes are located.

                                S 離線
                                S 離線
                                senmx
                                寫於 最後由 編輯
                                #24

                                @SGaist Thanks, If this is the case, how to solve it? There are other header files that can't be found. The header file of openssl is under /usr/include.

                                OPENSSL_LIBS='-L/home/sen/github/c/openssl-1.1.1g -lssl -lcrypto' ./configure -xplatform android-clang -prefix /usr/local/Qt-5.15.1-android --disable-rpath -nomake tests -nomake examples -android-ndk $ANDROID_NDK_HOME -android-sdk $AND    ROID_SDK_HOME -no-warnings-are-errors -openssl-linked
                                
                                1 條回覆 最後回覆
                                0
                                • SGaistS 離線
                                  SGaistS 離線
                                  SGaist
                                  Lifetime Qt Champion
                                  寫於 最後由 編輯
                                  #25

                                  The headers in /usr/includes are usually the ones installed by official packages. Where are the ones from the version you built ?

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  S 1 條回覆 最後回覆
                                  0
                                  • SGaistS SGaist

                                    The headers in /usr/includes are usually the ones installed by official packages. Where are the ones from the version you built ?

                                    S 離線
                                    S 離線
                                    senmx
                                    寫於 最後由 senmx 編輯
                                    #26

                                    @jsulm @SGaist
                                    I added the "-headerdir" is the same:

                                    ./configure -headerdir /home/sen/github/c/openssl-1.1.g/include ...
                                    

                                    I don't think this is the reason, because when the option openssl-linked is not enabled, the ./configure is successful, and these errors will also appear in the config.log.

                                    1 條回覆 最後回覆
                                    0
                                    • SGaistS 離線
                                      SGaistS 離線
                                      SGaist
                                      Lifetime Qt Champion
                                      寫於 最後由 編輯
                                      #27

                                      -headerdir is for where the headers will be installed.

                                      Use the -I parameter to add other paths to look for headers.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      S 1 條回覆 最後回覆
                                      1
                                      • SGaistS SGaist

                                        -headerdir is for where the headers will be installed.

                                        Use the -I parameter to add other paths to look for headers.

                                        S 離線
                                        S 離線
                                        senmx
                                        寫於 最後由 編輯
                                        #28

                                        @SGaist Well, I have tried all these parameters, it is probably a bug, because I saw the same problem in the bug feedback area. I am using the lower version now, the installation version.

                                        1 條回覆 最後回覆
                                        0

                                        • 登入

                                        • Login or register to search.
                                        • 第一個貼文
                                          最後的貼文
                                        0
                                        • 版面
                                        • 最新
                                        • 標籤
                                        • 熱門
                                        • 使用者
                                        • 群組
                                        • 搜尋
                                        • Get Qt Extensions
                                        • Unsolved