One Unified Global Perspective
Communications with a Global Perspective
Home
Intro
Contact Us
Voice over IP
PBX Solutions
Services
Support
Glossary
Open Source
Blog
Forum

WebMail





2008 Jan 22 - Tue

Creating a Crypto++ Shared Library in Eclipse/C++

The Crypto++ Library, which is an open sourced C++ Cryptographic library, has a makefile for creating a static library. The library turns out to be a large library. Static link times when linking into my project aren't fast, particularily when used in a VMWare based development environment. To make linking and running faster, a shared library would be much better. I'm using the library in an Linux hosted Eclipse/C++ based IDE.

As I really havn't built a makefile by hand before, I cheated and used Eclipse to create a project in which to create the library. These are the steps I used:

  • Create a new C++ project with a shared library as the target
  • Created a src directory in the project GUI, manually copied the .h and .cpp files into the directory
  • Excluded the test files (bench*, bench2* test*, validat*, adhoc*, datatest*, regtest*, fipsalgt*, dlltest*)
  • In the C++ Compiler Preprocessor settings, added CRYPTOPP_DISABLE_ASM, which seemed to fix an 'asm' message in vmac.cpp
  • Unchecking the 'All Warningss (-Wall)' box in the C++ Compiler Warnings settings will disable a flood of warnings
  • Added '-pthread', '-pipe', and '-fPIC' flags to the C++ Miscellaneous flags (-fpic might create smaller code, or -fpic may even be left out, but I havn't tried that).
  • Named the object 'cryptopp' in the C++ Linker Shared Library Settings for Shared Object Name (-Wl,-soname=)
  • Compiled the library, copied the resulting file 'libcryptopp.so' to /usr/lib, and ran 'ldconfig /usr/lib/libcryptopp.so'.

With a little more work, I could now take these settings from Eclipse's make file, and retrofit them into the original Crypto++ GNUMakefile, but I'll save that for another day.

As a backgrounder on shared libraries, I used the TLDP's Program Library HowTo as for reference.



Blog Content ©2008
Ray Burkholder
All Rights Reserved
ray@oneunified.net
(441) 505 7293
Available for Contract Work
Resume

RSS: Click to see the XML version of this web page.

View Ray 
Burkholder's profile on LinkedIn
technorati
Add to Technorati Favorites



January
Su Mo Tu We Th Fr Sa
   
22
   


Main Links:
Monitoring Server
SSH Tools
QuantDeveloper Code

Special Links:
Frink

Blog Links:
Sergey Solyanik
Marc Andreessen
HotGigs
Micro Persuasion
... Reasonable ...
Chris Donnan
BeyondVC
lifehacker
Trader Mike
Ticker Sense
HeadRush
TraderFeed
Stock Bandit
The Daily WTF
Guy Kawaski
J. Brant Arseneau
Steve Pavlina
Matt Cutts
Kevin Scaldeferri
Joel On Software
Quant Recruiter
Blosxom User Group
Wesner Moise
Julian Dunn
Steve Yegge

2008
Months
Jan
Nov Dec




Mason HQ

Disclaimer: This site may include market analysis. All ideas, opinions, and/or forecasts, expressed or implied herein, are for informational purposes only and should not be construed as a recommendation to invest, trade, and/or speculate in the markets. Any investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied herein, are committed at your own risk, financial or otherwise.