Statically linked xerces 3.0.0 does not work while dynamic works on Linux

So I am trying to statically link Xerces 3.0.0 on linux.

I did it already with dynamic link and it works, but in order to avoid dependancy I want to do it statically.

I changed all of the make files to do it in appropriate way

-Wl,-Bstatic ... -lxerces-c -Wl,-Bdynamic ...

But I am getting following errors:

  undefined reference to '__ctype_b'
  undefined reference to '__ctype_tolower'
  undefined reference to '__ctype_toupper'

I fixed those with brute force method found here

But there was another type of errors related to xerces.

Xerces/3.0.0/lib/libxerces-c.a(PosixMutexMgr.o): 
In function `xercesc_3_0::PosixMutexMgr::create(xercesc_3_0::MemoryManager*)':

PosixMutexMgr.cpp:(.text+0x84): undefined reference to `pthread_mutexattr_init'
PosixMutexMgr.cpp:(.text+0x95): undefined reference to `pthread_mutexattr_settype'
PosixMutexMgr.cpp:(.text+0xad): undefined reference to `pthread_mutexattr_destroy'
PosixMutexMgr.cpp:(.text+0xd0): undefined reference to `pthread_mutexattr_destroy'

It seems like its missing pthread so I tried adding it but that does not fix the problem... These errors are coming from Xerces ...and dynamic version works fine static one is failing.

Any ideas???

Thanks

Answers


The dynamic version of the xerces will have dependencies on libpthread that ensure the loader will pick up the correct library.

Specifying libphtread on your linker command line should fix those unresolved externals, did you (a) put in in the right place on the command line as the ordering matters and (b) did you try the both the static and dynamic versions of libpthread?


Need Your Help

Why use Mongrel2?

nginx lua webserver mongrel2

I'm confused what purpose Mongrel2 serves/provides that nginx doesn't already do.

Getting an “Object #<NodeList> has no method 'click'” error?

jquery forms

I am trying to add some multiple form fields in separate divs. But by adding some divs with buttons i get the following error when i click a button within a div:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.