How to compile Crypto++ 5.6.1 on Mac OS

1,826 views
Skip to first unread message

Liu

unread,
Oct 9, 2010, 12:46:18 AM10/9/10
to Crypto++ Users
Hi,

I'm a newbie to Crypto++. After I downloaded Crypto++ 5.6.1, I created
a file named "DumpMessage.cpp", which is from "Example -
DumpMessage.cpp" in Crypto++ User's Guide by denis bider. Then I
tried to compile it with "g++ DumpMessage.cpp". However, there are a
lot of errors complaining "Undefined symbols". For instance,
"CryptoPP::Filter::Flush(bool, int, bool)", referenced from:
vtable for CryptoPP::StringSourcein ccwjRr5Q.o
vtable for CryptoPP::SourceTemplate<CryptoPP::StringStore>in
ccwjRr5Q.o
vtable for CryptoPP::InputRejecting<CryptoPP::Filter>in
ccwjRr5Q.o"

Can anyone tell me what goes wrong here? Is there any step-by-step
guide on how to compile and run a Crypto++ test program in Mac,
starting from installing Crypto++? Thanks in advance.


-Liu
Platform:
Mac OS 10.5.8
i686-apple-darwin9-g++-4.0.1

Geoff Beier

unread,
Oct 9, 2010, 1:55:04 AM10/9/10
to Liu, Crypto++ Users
It's just a change in const-correctness in gcc since the doc was written.

Use this insetad for DumpMessage.cpp:
http://cryptopp.pastebin.com/8eFBpQMH

So, for example, if you create a directory called "scratch" in your
home directory, here's a transcript of a successful session:

$ cd scratch
$ mkdir cpp561
$ cd cpp561
$ curl -O http://www.cryptopp.com/cryptopp561.zip
$ unzip -a cryptopp561.zip
$ make -j4 libcryptopp.a
$ cd ..
$ mkdir dumpmessage
$ cd dumpmessage
$ curl http://cryptopp.pastebin.com/download.php?i=8eFBpQMH >DumpMessage.cpp
$ env CXXFLAGS="-I../cpp561" LDFLAGS="-L../cpp561 -lcryptopp" make DumpMessage
$ ./DumpMessage
48 6f 77 20 64 6f 20 79 6f 75 20 64 6f 3f

That's on OS X 10.6.4 with the latest developer tools installed.

HTH,

Geoff

> --
> You received this message because you are subscribed to the "Crypto++ Users" Google Group.
> To unsubscribe, send an email to cryptopp-user...@googlegroups.com.
> More information about Crypto++ and this group is available at http://www.cryptopp.com.

Liu

unread,
Oct 9, 2010, 8:44:17 PM10/9/10
to Crypto++ Users
Thanks, that totally works.

On Oct 9, 1:55 am, Geoff Beier <geoffbe...@gmail.com> wrote:
> It's just a change in const-correctness in gcc since the doc was written.
>
> Use this insetad for DumpMessage.cpp:http://cryptopp.pastebin.com/8eFBpQMH
>
> So, for example, if you create a directory called "scratch" in your
> home directory, here's a transcript of a successful session:
>
> $ cd scratch
> $ mkdir cpp561
> $ cd cpp561
> $ curl -Ohttp://www.cryptopp.com/cryptopp561.zip
> $ unzip -a cryptopp561.zip
> $ make -j4 libcryptopp.a
> $ cd ..
> $ mkdir dumpmessage
> $ cd dumpmessage
> $ curlhttp://cryptopp.pastebin.com/download.php?i=8eFBpQMH>DumpMessage.cpp
Reply all
Reply to author
Forward
0 new messages