This is the mail archive of the
cygwin-talk@cygwin.com
mailing list for the cygwin project.
Re: impossible to link a dll with libcygipc
- From: Reini Urban <rurban at x-ray dot at>
- To: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
- Date: Mon, 08 Nov 2004 16:57:19 +0100
- Subject: Re: impossible to link a dll with libcygipc
- References: <loom.20041108T152527-632@post.gmane.org>
- Reply-to: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
please ask support questions at the cygwin list! this is just for blabbeling
gilles schrieb:
Hello
I encountered a little problem (which I 'd resolved few months ago but I
changed of environment and it does
not work any more)
I am compiling a little "helloworld" program that uses ipc APIs (cygipc) and I
make it a dll (for JNI/JAVA purposes)
At link time , gcc can not found msget call !
I checked that the libcygipc.a static library is right located
(/cygdrive/c/cygwin/lib)
Command is :
gcc -Wl,--add-stdcall-alias -shared -lcygipc -o Native.dll HelloWorld.c
/cygdrive/c/Temp/ccnPWqb4.o(.text+0x7d):HelloWorld.c:
undefined reference to `msgget'
collect2: ld returned 1 exit status
On another configuration, Another similar, but more tricky "bug" occurs :
dll is OK linked BUT at load time from java, no error appears (unsatisfied link
error should !! ), programm just stay silent and does not load the native.dll
library.
File is :
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/msg.h>
#include <sys/signal.h>
#include <sys/types.h>
#include "HelloWorld_jni.h"
JNIEXPORT void JNICALL
Java_HelloWorld_sayHello( JNIEnv *env, jclass c )
{
print("Hello World !\r\n");
printf("Call msgget()\r\n")
msgget(50 , 0660 | IPC_CREAT);
printf("msgget() has been called\r\n");
}
because the ipc service must be available at runtime.
ipc-daemon2 in your case. this is cleary stated in the docs.
but better throw away cygipc (uninstall it) and use the new ipc library
within cygwin1.dll and cygserver.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/