From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,7ffa636010e427a1,start X-Google-Attributes: gidfa528,public From: sdurrant@howard.genetics.utah.edu Subject: pthread error using JNI on Digital Unix Date: 2000/04/19 Message-ID: <38FE1662.C74FF756@howard.genetics.utah.edu>#1/1 X-Deja-AN: 613285076 X-Accept-Language: en Content-Type: multipart/alternative; boundary="------------39F72DA010D664D3251C5913" X-Complaints-To: abuse@cc.utah.edu X-Trace: coward.ks.cc.utah.edu 956176048 22522 155.100.230.27 (19 Apr 2000 20:27:28 GMT) Organization: University of Utah Mime-Version: 1.0 Reply-To: ScottDurrant@earthling.net NNTP-Posting-Date: 19 Apr 2000 20:27:28 GMT Newsgroups: comp.unix.tru64 --------------39F72DA010D664D3251C5913 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I'm new to the Alpha world and am trying to use JNI. I have the 'hello native world' example from http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html running fine on Solaris 2.7, JDK 1.1.8, and gcc-2.95.2. However, using Digital Unix 4.0 D, JDK 1.1.8, and gcc-2.95.2 I am getting errors concerning pthread. But, because I am using g++ I don't have a -pthread option. Is there a workaround for this? Here are the specific errors I'm getting: g++ -O -I/usr/opt/java118/include -I/usr/opt/java118/include/alpha HelloNative.c -o libHelloNative.so In file included from HelloNative.h:2, from HelloNative.c:1: /usr/opt/java118/include/jni.h:49: #error "Modules that interface with Java must be compiled and linked with the -pthread option" *** Exit 1 Stop. The code from jni.h that is causing the error is: 47: /*** HDS add following error to ensure that users specify -pthread ***/ 48: #ifndef _REENTRANT 49: #error "Modules that interface with Java must be compiled and linked with the -pthread option" 50: #endif If I define _REENTRANT in the compile string I get the following error g++ -O -I/usr/opt/java118/include -I/usr/opt/java118/include/alpha -D _REENTRANT HelloNative.c -o libHelloNative.so /usr/ucb/ld: Unresolved: main collect2: ld returned 1 exit status *** Exit 1 Stop. -- ----------------------------------------------------------- Scott Durrant | ... send lawyers, guns sdurrant@howard.genetics.utah.edu | and money ... ----------------------------------------------------------- --------------39F72DA010D664D3251C5913 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit
Hi,
I'm new to the Alpha world and am trying to use JNI.
I have the 'hello native world' example from
http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html
running fine on Solaris 2.7, JDK 1.1.8, and gcc-2.95.2.
However, using Digital Unix 4.0 D, JDK 1.1.8, and gcc-2.95.2 I am getting errors
concerning pthread.
But, because I am using g++ I don't have a -pthread option.
Is there a workaround for this?
Here are the specific errors I'm getting:
g++ -O -I/usr/opt/java118/include -I/usr/opt/java118/include/alpha HelloNative.c -o libHelloNative.so In file included from HelloNative.h:2, from HelloNative.c:1: /usr/opt/java118/include/jni.h:49: #error "Modules that interface with Java must be compiled and linked with the -pthread option" *** Exit 1 Stop.
The code from jni.h that is causing the error is: 47: /*** HDS add following error to ensure that users specify -pthread ***/ 48: #ifndef _REENTRANT 49: #error "Modules that interface with Java must be compiled and linked with the -pthread option" 50: #endif
If I define _REENTRANT in the compile string I get the following error
g++ -O -I/usr/opt/java118/include -I/usr/opt/java118/include/alpha -D _REENTRANT HelloNative.c -o libHelloNative.so /usr/ucb/ld: Unresolved: main collect2: ld returned 1 exit status *** Exit 1 Stop.
-- ----------------------------------------------------------- Scott Durrant | ... send lawyers, guns sdurrant@howard.genetics.utah.edu | and money ... -------------------------------------------------------------------------39F72DA010D664D3251C5913--