impossible to link a dll with libcygipc
gilles
g_bourgeois@voila.fr
Mon Nov 8 14:30:00 GMT 2004
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
More information about the Cygwin-talk
mailing list