delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/14/02:34:36

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <005101bfed5d$b36bef80$2b2b7a35@bln.rt.daimlerchrysler.com>
From: "Horst Burmeister" <Horst DOT Burmeister AT DaimlerChrysler DOT com>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: Fw: help needed: DLL for JNI
Date: Fri, 14 Jul 2000 08:35:27 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300

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 took 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>"
Then I created (as suggested by Carl Thompson, using cygwin1.1.2) the dll
using Chuck Wilsons ld patch:
     "gcc -Wl,--out-implib,libNative.import.a -shared -o libNative.dll
theNativeMethod.o"

my problem:
But when I am loading this dll into my JAVA application it does nothing.

public class Main {
    public static void main(String[] args) {
   System.out.println("in Main bevor loadLibrary");
         System.loadLibrary("libNative");
   AClassWithNativeMethods
     c = new AClassWithNativeMethods();
           c.theNativeMethod();
   System.out.println("in Main after loadLibrary");
    }
 }

 Running java Main produces the folling ouput:
 /> java Main
 in Main bevor loadLibrary
 />
Some people have asked this or similar questions in the mailing
list but the answers (if any) are not successful.

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

Horst

Horst DOT Burmeister AT daimlerchrysler DOT com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019