[botan-devel] Sunstudio and undefined symbol

Jeremy C. Reed reed at reedmedia.net
Fri Apr 29 10:27:03 EDT 2011

This is with 1.8.11 on SunOS 5.10 Generic_118833-33 sun4u sparc 
SUNW,Sun-Fire-V240 using Sunstudio CC: Sun C++ 5.10 SunOS_sparc 

$ /usr/bin/CC -g -library=stlport4 -features=tmplife 
-features=tmplrefstatic -I/udir/jreed/opt/botan/include -D_XPG4_2 
-D__EXTENSION -L/udir/jreed/opt/botan/lib -lbotan -lpthread botantest.cc 
-lsocket -lnsl              
Undefined                       first referenced
 symbol                             in file
Botan::HashFunction*Botan::get_hash(const std::string &) botantest.o
void Botan::LibraryInitializer::initialize(const std::string &) 
ld: fatal: Symbol referencing errors. No output written to a.out

The code is:
#include <botan/botan.h>
#include <botan/hash.h>

int main ()
  using namespace Botan;
  HashFunction *h = get_hash("MD5");
  return 0;

Using GCC g++ (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
can compile it:

$ /usr/sfw/bin/g++  -g -O2  -D_XPG4_2 -D__EXTENSIONS__  
-I/udir/jreed/opt/botan/include  -L/udir/jreed/opt/botan/lib -lbotan 
botantest.cc -lrt -lsocket -lnsl
$ echo $?

Any ideas?  I didn't try 1.9.x yet, but I think we need our code to work 
with 1.8 and maybe older ones (so may need to workaround need for hash.h 
with older versions).

Thank you,

Jeremy C. Reed

p.s. Is there any good book on programming with open source crypto 

More information about the botan-devel mailing list