delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/02/15:02:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: thing1-200.fsi.com: ford owned process doing -bs
Date: Tue, 2 Mar 2004 14:02:29 -0600 (CST)
From: Brian Ford <ford AT vss DOT fsi DOT com>
X-X-Sender: ford AT thing1-200
Reply-To: cygwin AT cygwin DOT com
To: Claude DOT Barrouil AT onera DOT fr
cc: cygwin AT cygwin DOT com
Subject: Re: problem linking SHM functions
In-Reply-To: <40051D73.1070603@onera.fr>
Message-ID: <Pine.GSO.4.58.0403021341060.19531@thing1-200>
References: <40051D73 DOT 1070603 AT onera DOT fr>
MIME-Version: 1.0
X-IsSubscribed: yes

I'm digging out of my list backlog, and I noticed you didn't get a reply.
So, this is just in case you haven't figured it out yet.

On Wed, 14 Jan 2004 Claude DOT Barrouil AT onera DOT fr wrote:

> 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
> http://www.cygwin.com/ml/cygwin/2002-08/msg01296.html, 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 ?
>
At the time you wrote this, your best option was cygipc.  You could have
read: /usr/share/doc/Cygwin/cygipc-*.README for details

Five days later, cygwin-1.5.6 was released with System V shm, sem, msg
handling in cygserver.  It then became the prefered option.  But,
cygserver and the documentation was accidentally left out of that release.

On the last day of January, cygwin-1.5.7 was released and included the
missing files.  See /usr/share/doc/Cygwin/cygserver.README for details.

Finally, on February 09, cygipc was updated to happily cooexist with the
cygserver implementation.

</end history lesson>

So, get Cygwin 1.5.7 or newer and read its docs listed above.

> Thanks,
> 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 ---------------------------------------
>

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019