0

I am making a project with SWIG for binding C++ inside a java application I use Cmake to compile). I did a library containing a class named Data. I used SWIG to generate some Java code, and a file named Data.java was created. Then, I compiled all the java files into a .jar.

Now, I am trying to do an other project with Swig (still C++ to Java). This project has a class Test with a method taking a Data as argument, like this :

Test.h

class Test
{
    public:
        void process(Data input);
};

When I launch SWIG with cmake, it generates a Java file named SWIGTYPE_p_Data_t.java (which is normal, because it doesn't know the class Data).

I am wondering if there is a way to tell SWIG to use the .jar I created for the first library (or at least a folder containing the .java files), so it will have the Java class Data and it will not create the Java class SWIGTYPE_p_Data_t.java.

Fifi
  • 467
  • 6
  • 17
  • Is this what you're looking for: https://stackoverflow.com/a/30413268/168175 – Flexo Jul 26 '19 at 18:24
  • Yes, it seems to be that. I didn't know that it is possible to import an interface file. Thank you ! – Fifi Jul 29 '19 at 06:42

0 Answers0