Boost logo

Boost Users :

Subject: [Boost-users] cpp code and Boost.Interprocess compile error
From: hamsinv (hamsinv_at_[hidden])
Date: 2008-10-16 07:47:20


Hello All,

I was looking for using stl maps in shared memory, when i came across Boost
library.
I have downloaded boost_1_36_0 version. In the examples directory, there is
a cpp file for sharing stl maps named doc_map.cpp.

When i compile the same with the following command:
c++ -I $BOOST_ROOT doc_map.cpp -o shmmap

I got the following errors:
/tmp/ccEYJnov.o: In function
`boost::interprocess::shared_memory_object::priv_open_or_create(boost::interprocess::detail::create_enum_t,
char const*, boost::interprocess::mode_t)':
doc_map.cpp:(.text._ZN5boost12interprocess20shared_memory_object19priv_open_or_createENS0_6detail13create_enum_tEPKcNS0_6mode_tE[boost::interprocess::shared_memory_object::priv_open_or_create(boost::interprocess::detail::create_enum_t,
char const*, boost::interprocess::mode_t)]+0x163): undefined reference to
`shm_open'
/tmp/ccEYJnov.o: In function
`boost::interprocess::detail::mutexattr_wrapper::mutexattr_wrapper(bool)':
doc_map.cpp:(.text._ZN5boost12interprocess6detail17mutexattr_wrapperC1Eb[boost::interprocess::detail::mutexattr_wrapper::mutexattr_wrapper(bool)]+0x14):
undefined reference to `pthread_mutexattr_init'
doc_map.cpp:(.text._ZN5boost12interprocess6detail17mutexattr_wrapperC1Eb[boost::interprocess::detail::mutexattr_wrapper::mutexattr_wrapper(bool)]+0x2b):
undefined reference to `pthread_mutexattr_setpshared'
doc_map.cpp:(.text._ZN5boost12interprocess6detail17mutexattr_wrapperC1Eb[boost::interprocess::detail::mutexattr_wrapper::mutexattr_wrapper(bool)]+0x4d):
undefined reference to `pthread_mutexattr_settype'
/tmp/ccEYJnov.o: In function
`boost::interprocess::detail::mutexattr_wrapper::~mutexattr_wrapper()':
doc_map.cpp:(.text._ZN5boost12interprocess6detail17mutexattr_wrapperD1Ev[boost::interprocess::detail::mutexattr_wrapper::~mutexattr_wrapper()]+0xd):
undefined reference to `pthread_mutexattr_destroy'
/tmp/ccEYJnov.o: In function
`boost::interprocess::shared_memory_object::remove(char const*)':
doc_map.cpp:(.text._ZN5boost12interprocess20shared_memory_object6removeEPKc[boost::interprocess::shared_memory_object::remove(char
const*)]+0x33): undefined reference to `shm_unlink'
collect2: ld returned 1 exit status

Can anyone please tell me what i'm missing in the compilation.

Thank you.

-- 
View this message in context: http://www.nabble.com/cpp-code-and-Boost.Interprocess-compile-error-tp20012014p20012014.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net