2009/4/28 Rich Hickey <[email protected]>:
>
>
>
> On Apr 22, 9:41 am, "Antonio, Fabio Di Narzo"
> <[email protected]> wrote:
>> Hi all.
>> I'm having problems with using swig-generated wrappers with Clojure.
>> I'm running ubuntu-8.04-i386, gcc-4.2.4, swig-1.3.33, openjdk-1.6.0,
>> latest clojure release.
>>
>> I've cut down a minimal reproducible example.
>> The swig file:
>> ---file:swig_test.i---
>> %module swig_test
>> %{
>> int swig_test_whatever() {
>>   return 3;}
>>
>> %}
>> int swig_test_whatever();
>> ---cut---
>>
>> Compile with:
>> ---cut---
>> mkdir swig_test
>> swig -java -package swig_test -outdir swig_test swig_test.i
>> javac swig_test/*.java
>> export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
>> export JNI_CFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/
>> linux"
>> gcc -shared ${JNI_CFLAGS} swig_test_wrap.c -o libswig_test.so
>> ---cut---
>>
>> The swig-generated java itfc file is:
>> ---file:swig_test/swig_test.java---
>> package swig_test;
>> public class swig_test {
>>   public static int swig_test_whatever() {
>>     return swig_testJNI.swig_test_whatever();
>>   }}
>>
>> ---cut---
>>
>> The clojure code:
>> ---cut---
>> (import '(swig_test swig_test))
>>
>> (System/load
>>  (.concat (System/getProperty "user.dir") "/libswig_test.so"))
>> (swig_test/swig_test_whatever)
>> ---cut---
>> I get:
>> java.lang.UnsatisfiedLinkError:
>> swig_test.swig_testJNI.swig_test_whatever()I (NO_SOURCE_FILE:0)
>>
>> I can use "manually written" JNI wrappers with clojure and, vice-
>> versa, swig-generated wrappers with plain java code. What I'm missing
>> here? Anybody can help?
>>
>
> Did you try System/load before import?

Tried just now. Same error.

>
> Rich
>
> >
>



-- 
Antonio, Fabio Di Narzo
Ph.D. student at
Department of Statistical Sciences
University of Bologna, Italy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to