here is an example of 

                                                                            
                                                                            
                         

> package foo; 
>                                                                           
>                                                                             
>                                                            
> import com.sun.jna.Library;                                                
>                                                                             
>                                                             
> import com.sun.jna.Native;                                                
>                                                                             
>                                                              
> import com.sun.jna.Pointer;                                                
>                                                                             
>                                                             
>                                                                           
>                                                                             
>                                                              
> public interface C extends Library {                                      
>                                                                             
>                                                              
>     C INSTANCE = (C) Native.load("c",C.class);                            
>                                                                             
>                                                              
>                                                                           
>                                                                             
>                                                              
>     void printf(String format, Object... args);                            
>                                                                             
>                                                             
> }                                                                          
>                                                                             
>                                                             

         

calling this from a java main like this works as expected at the command 
line
  C.INSTANCE.printf("hello\n");

but from the clojure REPL,

(.printf foo.C/INSTANCE "hello "(into-array []))  


does not show anything

On Friday, February 14, 2020 at 6:30:51 PM UTC+8, Sonny To wrote:
>
> I am using JNA to call native C code. calling native code that outputs to 
> stdout does not show up in the Clojure REPL. stdout is redirected somewhere 
> that is not attached to *out*
>
> How can I get stdout from native code outputting to *out* in the REPL? 
> Without this, it makes it difficult to see what went wrong in the C code.
>
> thanks,
> Sonny
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/bd950525-defd-4696-948e-ac321dc5220e%40googlegroups.com.

Reply via email to