problem linking SHM functions
Wed Jan 14 11:53:00 GMT 2004

I have a program that uses shared memory functions shmget() and shmat() and 
that works fine under Linux.

My problem is that I couldn't find how to link it with Cygwin, although I 
installed le last full package, cygwin1.dll is in the PATH, any other 
compilations and linkages works fine.

All the info I could find is the thread starting at, and the links to 
cygipc and cygserver. But this info does not address this (supposed to be 
trivial) linkage problem.

Where is the relevant info ?

Claude Barrouil

--------------- the relevant part of the codee -----------------
#include <cygwin/shm.h>
ShmId = shmget(ShmKey, ShmSiz, 0666)
SharedData = shmat(ShmId,NULL,0)
--------------- the linkage failure-----------------------------
gcc  myprog.c -lm -o myprog.exe
{}/Temp/ccj8s9oV.o(.text+0x67):myprog.c: undefined reference to `_shmget'
{}/Temp/ccj8s9oV.o(.text+0xa3):myprog.c: undefined reference to `_shmat'
collect2: ld returned 1 exit status
---------------- the end ---------------------------------------

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list