我需要为我的项目生成dll才能使用Qt Cryptographic Architecture, 正如this简短的教程所说,我试着一步一步走。所以我开始将qmake添加到qt。
然后从qca
下载git://anongit.kde.org/qca.git
,导致该帖子中的svn过时。之后我从extra-cmake-modules
获取了git://anongit.kde.org/extra-cmake-modules
。
现在是编译它的时候了,我是从extra-cmake-modules
的qt cmakelist.txt打开的,出现了CmakeWizard,我选择了没有任何参数的MinGw Generator。
输出如下:
-- The C compiler identification is GNU 4.8.2
-- Check for working C compiler: C:/Qt/Qt5.3.1/Tools/mingw482_32/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Qt5.3.1/Tools/mingw482_32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for Sphinx Documentation Builder...
-- Sphinx Documentation Builder not found - documentation will not be built (see http://sphinx-doc.org/)
-- Configuring done
-- Generating done
-- Build files have been written to: G:/qca_new/extra_cmake_m-build
在下一步中,我打开了qt中的qca
。 CMake向导再次出现,正如教程所说我添加了这个论点:
-DECM_MODULE_PATH=G:\qca_new\extra_cmake_m-build
输出如下:
CMake Warning:
Manually-specified variables were not used by the project:
ECM_MODULE_PATH
Feature file will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/mkspecs/features
Documentation will be installed to C:/Qt/Qt5.3.1/Docs/Qt-5.3/html/qca
Man page will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/man
Pkg-config file will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/lib/pkgconfig
QCA prefix is C:/Qt/Qt5.3.1/5.3/mingw482_32
Plugins will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/plugins
Binary will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/bin
Library will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/lib
Public headers will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/include/Qca-qt5
Private headers will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/include/Qca-qt5
[31m
!!!!!!!!!!!!!!!!!!!!!ATTENTION!!!!!!!!!!!!!!!!!!!!!!
!! QCA will be installed in Qt prefix !!
!! If you want to install in /usr/local !!
!! you MUST explicity define CMAKE_INSTALL_PREFIX !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[0m
qca-gcrypt off
qca-gnupg on
qca-logger on
qca-nss off
qca-ossl on
qca-pkcs11 off
qca-softstore on
Plugins:
qca-botan off
qca-cyrus-sasl off
CMake Warning at plugins/qca-ossl/CMakeLists.txt:25 (message):
qca-ossl will be compiled without AES CTR mode encryption support
CMake Warning at plugins/qca-ossl/CMakeLists.txt:18 (message):
qca-ossl will be compiled without MD2 digest algorithm support
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: C:/Qt/Qt5.3.1/Tools/mingw482_32/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Qt5.3.1/Tools/mingw482_32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Qt/Qt5.3.1/Tools/mingw482_32/bin/g++.exe
-- Check for working CXX compiler: C:/Qt/Qt5.3.1/Tools/mingw482_32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Building with Qt5 support
-- Installed package is NOT relocatable
-- Checking for certstore..
-- Using built in certstore.
-- certstore path: G:/qca_new/qca/certs/rootcerts.pem
-- Looking for include file sys/filio.h
-- Looking for include file sys/filio.h - not found
-- Performing Test MLOCK_TAKES_VOID
-- Performing Test MLOCK_TAKES_VOID - Failed
-- mlock(2) does not take a void *
-- Found OpenSSL: C:/Program Files/OpenVPN/bin/ssleay32.dll;C:/Program Files/OpenVPN/bin/libeay32.dll (found version "0.9.8h")
-- Looking for EVP_md2
-- Looking for EVP_md2 - not found
-- Looking for EVP_aes_128_ctr
-- Looking for EVP_aes_128_ctr - not found
-- Configuring done
-- Generating done
-- Build files have been written to: G:/qca_new/qca-build
之后我被困住了。我尝试构建项目qca但我得到了错误
...\qca\plugins\qca-ossl\qca-ossl.cpp:5808: error: 'SSL_SESSION_get_compress_id' was not declared in this scope
sessInfo.isCompressed = (0 != SSL_SESSION_get_compress_id(ssl->session));
我搜索了它,发现有人已经创建ticket与此问题有关。当这条路径没有给我需要的结果时,我走了另一条路。
我也尝试过cmake-gui。 我的参数是源代码(我从git下载的这个qca repo)和我应该构建二进制文件的文件夹的路径。配置并生成单击,这是输出。
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Building with Qt5 support
Installed package is NOT relocatable
Checking for certstore..
Using built in certstore.
certstore path: G:/qca_new/qca/certs/rootcerts.pem
mlock(2) does not take a void *
CMake Warning at plugins/qca-ossl/CMakeLists.txt:18 (message):
qca-ossl will be compiled without MD2 digest algorithm support
CMake Warning at plugins/qca-ossl/CMakeLists.txt:25 (message):
qca-ossl will be compiled without AES CTR mode encryption support
Plugins:
qca-botan off
qca-cyrus-sasl off
qca-gcrypt off
qca-gnupg on
qca-logger on
qca-nss off
qca-ossl on
qca-pkcs11 off
qca-softstore on
QCA prefix is C:/Qt/Qt5.3.1/5.3/mingw482_32
Plugins will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/plugins
Binary will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/bin
Library will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/lib
Public headers will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/include/Qca-qt5
Private headers will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/include/Qca-qt5
Feature file will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/mkspecs/features
Documentation will be installed to C:/Qt/Qt5.3.1/Docs/Qt-5.3/html/qca
Man page will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/man
Pkg-config file will be installed to C:/Qt/Qt5.3.1/5.3/mingw482_32/lib/pkgconfig
Configuring done
Generating done
在两个metod之后我搜索了任何dll但没有出现,这两种方法都生成了包含内容的构建文件夹,但我不知道如何获取dll并将其添加到项目中。
构建内容出现的文件夹树看起来像this
更新:我在虚拟方法中评论了一些代码,以避免在构建期间出错。 现在我可以构建3个dll:
libqca-gnupg的, 当qt尝试构建libqca-ossl.dll时出现错误:
C:/ Program Files / OpenVPN / bin / ssleay32.dll:文件无法识别:文件
格式无法识别
collect2.exe:错误:ld返回1退出状态
plugins \ qca-ossl \ CMakeFiles \ qca-ossl.dir \ build.make:104:目标'lib / qca-qt5 / crypto / libqca-ossl.dll'的配方失败
mingw32-make 2: * [lib / qca-qt5 / crypto / libqca-ossl.dll]错误1
CMakeFiles \ Makefile2:395:目标'plugins / qca-ossl / CMakeFiles / qca-ossl.dir / all'的配方失败
mingw32-make 1:* [plugins / qca-ossl / CMakeFiles / qca-ossl.dir / all]错误2
Makefile:137:目标'all'的配方失败
mingw32-make:*** [全部]错误2
15:17:12:进程“C:\ Qt \ Qt5.3.1 \ Tools \ mingw482_32 \ bin \ mingw32-make.exe”退出,代码为2。
我很好奇为什么它会转到openVpn文件夹。
然后呢
如果对此问题有任何帮助,我将不胜感激。