impossible to link a dll with libcygipc
Reini Urban
rurban@x-ray.at
Mon Nov 8 15:57:00 GMT 2004
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/
More information about the Cygwin-talk
mailing list