Crypto++ & MinGW

Here is described how to compile Crypto++ library in Windows MinGW enviroment.
I didn't find good step-to-step tutorial, so here is mine. The main problem is makefile, so working version of it is attached.

OS: Windows XP Professional SP3
MinGW: v4.4 (shipped with Qt SDK 4.7.3)
Crypto++: v5.6.1

  • Extract source archive to C:\cryptopp
  • Rename adhoc.cpp.proto to adhoc.cpp
  • Edit GNUmakefile
    • Remove lines from 2nd to empty line before SRCS = $(wildcard *.cpp)
    • Remove line $(RANLIB) $@
    • Remove lines from adhoc.cpp: adhoc.cpp.proto to next empty line
    • Add lines LDLIBS += -lws2_32, ARFLAGS = rc at the beginning of file
  • Open Command Prompt (with configured %PATH% for MinGW)
    • cd C:\cryptopp
    • mingw32-make
    • mingw32-make test
    • mkdir include\cryptopp
    • mkdir lib
    • copy *.h include\cryptopp
    • copy *.a lib
If everything goes right, lib/ with libcryptopp.a and include/ directories are the result.
This directories or their contents must be visible by your compiler as library and include path.
ċ
GNUmakefile
(3k)
Ievgen Sychov,
Aug 23, 2011, 12:54 PM
Comments