Hi all!

I would like to compile my project against static libraries

If I compile my project in following manner:

c++ -I/usr/local/include/boost/1.49.0/ -c -o azio.o azio.cpp
c++ -L/usr/local/lib64/boost/1.49.0/  azio.o -lboost_system -o bin/azio 

It is OK. But if I use static libraries:

c++ -I/usr/local/include/boost/1.49.0/ -c -o azio.o azio.cpp
c++ -L/usr/local/lib64/boost/1.49.0/  azio.o /usr/local/lib64/boost/1.49.0/libboost_system.a -o bin/azio

I have got error:
azio.o: In function `boost::asio::detail::posix_tss_ptr_create(unsigned int&)':
azio.cpp:(.text._ZN5boost4asio6detail20posix_tss_ptr_createERj[boost::asio::detail::posix_tss_ptr_create(unsigned int&)]+0x19): undefined reference to `pthread_key_create'
azio.o: In function `boost::asio::detail::posix_thread::~posix_thread()':
........
........
boost::asio::detail::task_io_service::thread_info>::context>::operator=(boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context*)]+0x20): undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status

I used strings to know where is function pthread_key_create. I found in libboost_thread.so. Next my step was:

c++ -L/usr/local/lib64/boost/1.49.0/  azio.o /usr/local/lib64/boost/1.49.0/libboost_system.a /usr/local/lib64/boost/1.49.0/libboost_thread.a -o bin/azio

I've try out to mix up places libraries and object file 
c++ .. azio.o libboost_system.a libboost_thread.a -o bin/azio
c++ .. libboost_system.a libboost_thread.a azio.o -o bin/azio
c++ .. libboost_thread.a azio.o libboost_system.a   -o bin/azio

But error is still.

Thanx,
Sergiy