At 1:20 01 Jan 2001 +0530, Dushyanth Harinath wrote:
> Iam trying to use a existing c library and build a java based interface for
> it.I have written a java program for this and created the corresponding
> header file and i have also written a c file to execute the native methods.
> while compi
Thank you Nathan,
You were right. I thought if you use C++ files the linker picks up
correct libraries automatically - not yet.
Anyway, your answer reminds me how great our listserver is.
Thank you again,
Jacob Nikom
Nathan Meyers wrote:
>
> On Fri, Nov 19, 1999 at 06:44:48PM -0500, Jacob
On Fri, Nov 19, 1999 at 06:44:48PM -0500, Jacob Nikom wrote:
> I am writing JNI application called MainPanel using Java, C++ and
> a bit of C. It compiles and links without problem, but when I run
> it, it crushes with the message...
My guess is that you linked your shared library using gcc ins
Wes Biggs wrote:
>
> optima wrote:
>
> > cc -G NativeHello.c NativeHelloImp.c -o libHello.so
> > ,I encount a problum
> > "cc: unrecognized option `-G'
> > /usr/lib/crt1.o(.text+0x36): undefined reference to `main'"
The problem is that there is no "-G" option to gcc. If you want to build
optima wrote:
> cc -G NativeHello.c NativeHelloImp.c -o libHello.so
> ,I encount a problum
> "cc: unrecognized option `-G'
> /usr/lib/crt1.o(.text+0x36): undefined reference to `main'"
> before I do this ,I had copy the include file of java/include into
> /usr/include ,and I copy the *.h in
Hi Denis.
You should build your library using g++ instead of ld.
The reason is that g++ links additional object files that
are essencial for a library to work well (namely, crtbegin.o,
crtend.o, crti.o, and crtn.o).
Try:
g++ -fPIC -I[jdk-root]/include -I[jdk-root]/include/genunix Load.cc Load.
Mark Fardal wrote:
>
> > What happens if you use the debug version of the java interpreter (java_g)?
> >
> > Steve
> >
>
> The result is the same as was reported with 1.1.5, it reads a single string
> and returns fine.
>
> weka:native[ 996 ] java_g Prompt
> Type a line: hi there
> A diagnostic
> What happens if you use the debug version of the java interpreter (java_g)?
>
> Steve
>
The result is the same as was reported with 1.1.5, it reads a single string
and returns fine.
weka:native[ 996 ] java_g Prompt
Type a line: hi there
A diagnostic message...
User typed: hi
This is cor
"Works" on Steve Byrne's jdk1.1.5v7 (except seems to pick up the string
only to a space, not end of line...):
[user@ravel native]$ java Prompt
Type a line: Hi there
User typed: Hi
[user@ravel native]$ java Prompt
Type a line: Hithere
User typed: Hithere
Hope it helps.
Bob L.
--
Robert Lynch-B