Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2006-01-28 05:32:06

> When I tried to upgrade shmem 0.9 in vault I am failing to compile on
> Cygwin using gcc 3.4.4 with the following error message.
> e:/boost/boost_1_33_1/boost/shmem/shared_memory.hpp:585: error: there are no
> arguments to `shm_open' that depend on a template parameter, so a
> declaration of `shm_open' must be available
> e:/boost/boost_1_33_1/boost/shmem/shared_memory.hpp:585: error: (if you use
> `-fpermissive', G++ will accept your code, but allowing the use of an
> undeclared name is deprecated)
> I went a head and added the following two lines to shared_memory.hpp after
> which I was able to compile.

I didn't know that someone was trying to use this in cygwin! Last time I
checked, cygwin had not PTHREAD_PROCESS_SHARED support so I thought
Shmem couldn't work with cygwin. I'm wrong or has this changed?

You've said "I tried to upgrade shmem 0.9" so I suppose you have tested
previous Shmem versions. What was the latest version of Shmem that you
could compile?

I don't know much about cygwin but shared_memory.hpp header says:

#if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32)
# include <boost/shmem/sync/win32/win32_sync_primitives.hpp>

# include <fcntl.h> //O_CREAT, O_*...
# include <sys/mman.h> //mmap
# include <unistd.h> //ftruncate, close
# include <semaphore.h> //sem_t* family, SEM_VALUE_MAX
# include <string> //std::string
# include <sys/stat.h> //mode_t, S_IRWXG, S_IRWXO, S_IRWXU,
# else
# error Unknown platform
# endif

So if you have calls to shm_open in the code the

#if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32)

condition should be true and since you don't get

# error Unknown platform

I suppose BOOST_HAS_UNISTD_H is true. And posix says

# include <sys/mman.h> //mmap

is enough to get shm_open and shm_unlink declarations. Can you
investigate this a bit further?



Boost list run by bdawes at, gregod at, cpdaniel at, john at