I studied Java , there was a topic about JNI (little written). I liked the essence, I decided to try it, I searched for a long time in google , I didn’t find anything (or I can’t say I did not understand). There is such a java code:

 public class Main{ static{ System.loadLibrary("lib.dll"); } public static void main(String args[]){ printString("TEST!\n") } } 

C ++ wanted to write such a method

 void printString(string str){ std::cout << str; } 

How to compile in dll and write this method?

  • I write under Windows I am not Linux or Android, Secondly, my question can be asked more simply - how to work with JNI - Razor
  • Specifically, under your question is an example from Microsoft. - Flowneee
  • @Flowneee, thanks! - Razor

0