0

I am working on a project in which I need to create a java wrapper class to call external functions of an un-managed c dll using SWIG.

The tutorials on SWIG main site and other resources out there always need the implementing c source files and the header files.

Is there a way to reference the dll to SWIG and create the Java wrapper, and if there isn't, is there another approach to achieve my goal.

Thanks.

  • See my answer to a similar question: http://stackoverflow.com/a/10531844/168175 – Flexo Oct 05 '13 at 21:05
  • I saw your answer in the link you provided, and created the SWIG interface file, but now how would I be able to compile and link that interface file into a shared library (.so) file. – موسى شاور Oct 07 '13 at 13:44
  • And how would it include the dll file as a source file, because as you know the implementation is inside it. – موسى شاور Oct 07 '13 at 14:00
  • You have to deduce the function prototypes and types you care about to produce a header file that you can %include if you don't have one available. – Flexo Oct 07 '13 at 17:00
  • Thank you Flexo for your cooperation, but I tried to figure out how to include the dll and headers in my SWIG interface file but it always fails, and I think it worth mentioning that I am ultimately aiming to use the swig wrapper code to build an (.so) file to be used in an Android application, and also am new to swig and java and android, if you you can put some sample code to show me how it is done I would appreciate it. – موسى شاور Oct 08 '13 at 18:21

0 Answers0