Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Compilation Errors...... Classpath??



It looks like the include path you specified (-I /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Headers) does not exist, try and locate the actual location on your filesystem and use it instead...

eg. on my system they are located in /Library/Java/Home/include


-----Original Message-----
From:	java-dev-bounces+d.barnier=email@hidden on behalf of sam aspin
Sent:	Mon 1/30/2006 5:25 AM
To:	email@hidden
Cc:	
Subject:	Compilation Errors...... Classpath??
Hi Guys,

Im trying to follow a new JNI tutorial (see here: 
http://www.mindspring.com/~david.dagon/jni/Native.txt ) and am getting a 
selection of compilation errors when trying to build my library at step 5...

**************************************************************

sam-aspins-mac-mini:~/Jan06/com2 samaspin$ cc -bundle -o libHello.jnilib 
-framework JavaVM \ 
-I/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Headers \ . 
Hello.c

powerpc-apple-darwin8-gcc-4.0.0:  
-I/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Headers: No 
such file or directory
powerpc-apple-darwin8-gcc-4.0.0:  .: No such file or directory
Hello.c:4:17: error: jni.h: No such file or directory
In file included from Hello.c:6:
HelloWorld.h:15: error: syntax error before 'void'
HelloWorld.h:16: error: parse error before '*' token
HelloWorld.h:16: warning: data definition has no type or storage class
Hello.c:7: error: syntax error before 'void'
Hello.c:8: error: parse error before '*' token
Hello.c: In function 'Java_HelloWorld_sayHello':
Hello.c:10: error: 'env' undeclared (first use in this function)
Hello.c:10: error: (Each undeclared identifier is reported only once
Hello.c:10: error: for each function it appears in.)
Hello.c:10: error: 'strMessage' undeclared (first use in this function)

*************************************************************************

I've also tried it using the exact path specified in the example but after 
doing some googling have found that this actually points to a 'shortcut' 
file and anot the actual jni.h header.

It looks to me like the first problem is that it's not locating the Headers 
and subsequently the jni.h header file, am i correct?

I'm hoping that if i get this part sorted then the other errors might 
dissapear as well!

I have done some googling and was wondering if perhaps this has something to 
do with classpaths??  how do i check/set-up the classpath??

any help will be greatly received.

thanks

Sam Aspin


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Compilation Errors...... Classpath?? (From: "sam aspin" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.