samedi 23 mai 2015

Setting up crypto++

I downloaded crypto++ 5.6.2 (the zip file) and built it using just make (I have gcc 4.8.1). It seemed to work and gave me a libcryptopp.a file.

Now, to test the setup, I tried to compile the test.cpp file that was provided with the download (link here: http://ift.tt/1BibqQ6).

First, I compiled it with

g++ -Wall -std=c++11 -g -Iinclude -I/c/libraries/cryptopp562 -c test.cpp -o obj/test.o

which gave a lot of warnings (deprecations and unused variables mostly) but worked and I got the test.o file.

Now, to link it, I used

g++ obj/test.o -o bin/test -L/c/libraries/cryptopp562 -lcryptopp

But this gave a lot of undefined reference errors and failed.

For example

D:\.../test.cpp:119: undefined reference to `RegisterFactories()'

But when you look at the test.cpp file (http://ift.tt/1BibqQ6), there is only the declaration to RegisterFactories(), but no definition. Does this mean, it needs to find it from the library? (A local declaration shouldn't be needed in this case, no?)

Ok, so what do I have to do to get the whole library to work? Use gmake to build it? Or use an older gcc? Or maybe my compile/link commands are incorrect?

Aucun commentaire:

Enregistrer un commentaire