Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ColdStone

macrumors newbie
Original poster
Jul 24, 2011
1
0
I have some JNI code that I wrote using the some java code for android platform in 10.7 (Lion) and Xcode 4.3, but when I try to use the gcc, I get some strange errors.

Here is the output of mine, can anyone tell me whats going on?

Thanks.

Code:
MacBook-Pro:JNI $$ cc -dynamiclib -o hellojni.jnilib hellojni.o -framework JavaVM
Undefined symbols for architecture x86_64:
  "_print", referenced from:
      _Java_HelloJNI_printHello in hellojni.o
      _Java_HelloJNI_printString in hellojni.o
     (maybe you meant: _Java_HelloJNI_printHello, _Java_HelloJNI_printString )
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
 
Here is the output of mine, can anyone tell me whats going on?

The code is using a symbol named 'print', but there is no such function or global defined in any referenced library.

The 'print' symbol is used from two different functions. Their names are given.

There's no way to tell anything else without seeing the source C file that was compiled to produce hellojni.o.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.