This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

still help needed regarding DLL for JNI


Hello all,

my task: 
I have an UNIX-based C++ application that is used via a shared-object library 
and JNI in Java on a Unix machine.
Now I want to make a dll library from this application using cygwin gnu tools 
and use this dll using JNI in Java under NT.

To test this way of porting the software to NT I started with a little example.
So I wrote a small C programm, printing "Hello World" (not very witty, I know), 
adding "__declspec(dllexport)" before the native function. 
I compiled the file using "gcc -c theNativeMethod.c <more compiler flags>"

my problem:
Then I tried (as suggested by Carl Thompson, using cygwin1.1.2) to get the dll:
    "gcc -Wl,--out-implib,libNative.import.a -shared -o libNative.dll theNativeMethod.o"

This results in the following messages:
    Creating library file: libNative.import.a        (sounds good so far ;-)
    bfd_close: libNative.import.a Invalid operation
    collect2: ld returned 1 exit status

I am really in despair! I am quite new to all this stuff. 
I have no real experience, neither in C++ , nor NT programming.
So any suggestions are really welcome!

Horst

Horst.Burmeister@daimlerchrysler.com or
Horst.Burmeister@berlin.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]