On Tue, May 1, 2018 at 8:19 AM,  <[email protected]> wrote:
> Firstly asked at: https://github.com/weidai11/cryptopp/issues/651
>
>
> As the title says, everything failing to build. I have this code (below),
> and I'm not able to build it (logs below the code). I use CMake to create
> the Visual Studio solution file. I also tried version 6.1.0 and 6.0.0, same
> problem occurs.
>
>
> Steps to build CryptoPP: download CryptoPP source code (from website) ->
> open cryptest.sln -> Retarget solution (to use my version of Windows SDK -
> 10.0.16299.0) -> Ok -> Batch Build -> tick cryptlib - Release|Win32 -> Build
>
>
> cryptopp-test.cpp:
>
> https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cryptopp-test-cpp
>
>
> CMakeLists.txt:
>
> https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cmakelists-txt
>
>
> $cmake ..
>
> https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cmake
>
>
> $msbuild cryptopp-test.sln
>
> https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-msbuild-cryptopp-test-sln
>
>
> However if I'll try to build this code (below) using the same steps (and
> CMakeList.txt) as above, everything is fine.
>
> https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cryptopp-test-cpp-works-well

I have very little CMake skills so I am probably one of the last
people who should advise about it... There's a minimally maintained
CMake for Crypto++ located at
https://github.com/noloader/cryptopp-cmake . You might consider taking
a look at it.

There's also a wiki page available for the Cmake  files at
https://www.cryptopp.com/wiki/CMake . You might find some helpful
information there, too.

The GNUmakefile will provide most/all the flags you should need for
each source file. For example, notice the *-simd.cpp files require
additional architectural flags:

    $ make -j 4
    ...
    g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
    g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cpu.cpp
    g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c integer.cpp
    ...
    g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -mssse3 -c aria-simd.cpp
    ...
    g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -msse4.1 -c blake2-simd.cpp
    ...

Finally, you can list the library source files and the test source files with:

$ make sources
Library sources: cryptlib.cpp cpu.cpp integer.cpp 3way.cpp adler32.cpp
algebra.cpp algparam.cpp  ...

Library headers: 3way.h adler32.h adv-simd.h aes.h algebra.h
algparam.h androidpay.h arc4.h ...

Test sources: adhoc.cpp test.cpp bench1.cpp bench2.cpp validat0.cpp
validat1.cpp validat2.cpp ...

Test headers: bench.h factory.h validate.h

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to