cryptopp820 compiled in the QtCreator

Official website https://www.cryptopp.com/release820.html download the Crypto ++ 8.2

Compilation process is quite troublesome. QtCreator is not directly translated, but the embodiment is given with reference to a pro generated, the command-line tools Qt provided by the following operations. See you install the Qt MinGW compiler or VS edition.

cd \cryptopp820
qmake -project

It describes 2,3 operation I did not carry out, because 2 has been officially get rid of. I intend to directly QtCreator compiled, no deleted.

5 described only for its operation TEMPLATE = app modify TEMPLATE = lib

TEMPLATE = lib

Then open the file in the pro QtCreator may also be modified where mentioned above TEMPLATE = lib

MinGW current version, there is no need to add the following phrase is.

LIBS += lws2_32

Then compile is being given at this time, similar to the following error

..\cryptopp820\aria_simd.cpp: In function 'void CryptoPP::ARIA_ProcessAndXorBlock_SSSE3(const byte*, CryptoPP::byte*, const byte*, CryptoPP::word32*)':
..\cryptopp820\aria_simd.cpp:156:76: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
^
In file included from D:/Qt/Qt*****/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/pmmintrin.h:31:0,
from D:/Qt/Qt*****/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/tmmintrin.h:31,
from ..\cryptopp820\aria_simd.cpp:14:
D:/Qt/Qt*****/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/emmintrin.h:615:1: error: inlining failed in call to always_inline '__m128i _mm_set_epi8(char, char, char, char, char, char, char, char, char, char, char, char, char, char, char, char)': target specific option mismatch
_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12,
^~~~~~~~~~~~
..\cryptopp820\aria_simd.cpp:156:76: note: called from here
const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);

Reference 3 was added some parameters,

Reference 4 then belongs to the set of instructions which inter official website search function,

Reference 2 describes the then re cryptopp6.0 to find the corresponding parameters, you can also follow the parameter guess

QMAKE_CXXFLAGS += "-msse4.2"
QMAKE_CXXFLAGS += "-msse4.1"
QMAKE_CXXFLAGS += "-msse3"
QMAKE_CXXFLAGS += "-msse2"
QMAKE_CXXFLAGS += "-mavx"
QMAKE_CXXFLAGS += "-mavx2"
QMAKE_CXXFLAGS += "-mpclmul"
QMAKE_CXXFLAGS += "-maes"
QMAKE_CXXFLAGS += "-msha"

It was discovered that three can be removed, to simplify

QMAKE_CXXFLAGS += "-msse4.2"
QMAKE_CXXFLAGS += "-mavx"
QMAKE_CXXFLAGS += "-mavx2"
QMAKE_CXXFLAGS += "-mpclmul"
QMAKE_CXXFLAGS += "-maes"
QMAKE_CXXFLAGS += "-msha"

And then compile the code errors encountered, carefully looked at the path and found the contents are TestPrograms, directly in the pro file to directly shield under the relevant catalog, what we want is a dynamic library.

..\cryptopp820\TestPrograms\test_arm_aes.cxx:1:10: fatal error: arm_neon.h: No such file or directory
#include <arm_neon.h>
^~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [Makefile.Release:5389: release/test_arm_aes.o] Error 1
..\cryptopp820\TestPrograms\test_arm_asimd.cxx:1:10: fatal error: arm_neon.h: No such file or directory
#include <arm_neon.h>
^~~~~~~~~~~~
compilation terminated.

Then compile, and ultimately generate cryptopp820.dll libcryptopp820.a file

Proceed to Step 8 of Reference 1

8. After the completion of the translation, we need to generate copies of two documents, there is not the same place, I use mingw, so take .a files are copied to the following path, but I did not copy the dll file past can compile successful, in order to avoid problems, also copied to the Tools \ mingw \ bin \ below the

D:\cryptopp\release\libcryptopp552.a 拷贝到 <Qt dir>\Tools\mingw\lib
D:\cryptopp552\release\cryptopp552.dll拷贝到<Qt dir>\bin 以及 拷贝到<Qt dir>\Tools\mingw\bin

Here <Qt dir> represents your own Qt installation directory

9. Create a name <Qt dir> \ include under the folders to cryptopp

From D: \ cryptopp820 copy all headers header (.h) to <Qt dir> \ include \ cryptopp.

 

reference

1 https://www.cnblogs.com/AvalonRookie/articles/6937587.html

2 https://www.cryptopp.com/release600.html

3 https://blog.csdn.net/willib/article/details/52386087

4 https://software.intel.com/sites/landingpage/IntrinsicsGuide/

Published 14 original articles · won praise 4 · Views 7336

Guess you like

Origin blog.csdn.net/yxmlhc/article/details/104070304