所以我想在Linux上靜態鏈接Xerces 3.0.0。靜態鏈接的xerces 3.0.0在Linux上動態工作時不起作用
我已經做了它與動態鏈接,它的工作原理,但爲了避免依賴我想靜態做它。
我改變了所有的製作文件做適當的方式
-Wl,-Bstatic ... -lxerces-c -Wl,-Bdynamic ...
但我得到以下錯誤:
undefined reference to '__ctype_b'
undefined reference to '__ctype_tolower'
undefined reference to '__ctype_toupper'
我固定的那些窮舉法找到here
但還有另一種與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'
好像缺了並行線程,所以我嘗試添加它,但這並不解決問題... 這些錯誤是從Xerces的未來......而動版能正常工作靜態的失敗。
任何想法???
感謝
以及我在-Wl,-Bstatic之後添加了-lpthread。 – grobartn 2010-12-01 18:14:04