This is the mail archive of the
cygwin-talk@cygwin.com
mailing list for the cygwin project.
impossible to link a dll with libcygipc
- From: gilles <g_bourgeois at voila dot fr>
- To: cygwin-talk at cygwin dot com
- Date: Mon, 8 Nov 2004 14:26:37 +0000 (UTC)
- Subject: impossible to link a dll with libcygipc
- Reply-to: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
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");
}
TIA
Giles