How to create a dll to be used on 64-bits windows computer with 32-bits Java environment

Hello,
I need to create a dll from a matlab function, this dll will be used on a 64-bits windows computer BUT with a 32-bits Java Environment.
My configuration: R2017a Windows 64-bits.
What I tried:
With Matlab coder:
-Load function and check for errors: OK
-Generate code with: Build type (Dynamic_library), Language (C), Hardware Board (none), Device (Generic)(64-bit Embedded Processor (LP64)).
-dll is generated with success but impossible to load it with Eclipse and Java 32-bits Environment.
I am not a specialist of these questions, and I am unable to find any solution with our Google dear friend.
Thanks,

 Réponse acceptée

We finally found a solution, in case someone could need the answer.
Since we want to include a Matlab function in a Java project, we can use Matlab compiler to generate a .jar file.
To do that, one needs to install Java Development Toolkit version corresponding to the one used by Matlab version (use version - java command to get this information). Once it is install there is a trick to set the path to the Java installation, to know if this path is defined, use the command getenv JAVA_HOME. If it is empty, this need to bet setup (many discussions can be found on this point), from my side I just added the path of JAVA installation: right click on My computer>properties>advanced system settings>environment variable.
Then generate the .jar file and import it in eclipse, many procedures to do that can be found. Firstly, follow the readme generated by matlab, you could need to install Matlab runtime on the computer if needed.
Hope it can help:

Plus de réponses (1)

An update of the situation, if someone could hopefully help me.
I installed a 32 bits version of Matlab (R2013a).
I created a .dll with it and it can be successfully loaded in Eclipse (32 bits).
But we encountered a problem with entry point function. We found that the name of the function has been modified during compilation and now starts with an underscore. Is it possible to change this setting?
Also, the dll is generated but reading the target build log is see the following error:
"### Created: ./easycodekode.dll"
23 "### Deleting command file: easycode.lnk"
24 process_begin: CreateProcess(NULL, rm -f easycode.lnk, ...) failed.
25 make (e=2): The system cannot find the file specified.
26 gmake: *** [easycodekode.dll] Error 2
27 The make command returned an error of 2
28 'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
29 operable program or batch file.
Any idea about how to solve this ?

Catégories

Produits

Version

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by