Loading a DLL in MATLAB through JAVA
Mostrar comentarios más antiguos
Hi,
I have a running application in Mathlab, that also uses some C DLL files.
I have created a JAVA package using the JA builder of mathlab functions. Then I put the DLLs in the JAVA main project folder.
I could invoke any method that doesnt use the DLL and it works fine. But whenever I invoke a method that uses the DLL files, it crashes and here is the stacktrace.
{??? Error using ==> loadlibrary at 477 FAiled..Error using ==> loadlibrary at 477 There was an error loading the library There was an error loading the library "C:\Users\AUG\Documents\Backup\SourceTracing\epanet2.dll" "C:\Users\AUG\Documents\Backup\SourceTracing\epanet2.dll" Undefined function or variable 'epanet2_proto'. Undefined function or variable 'epanet2_proto'.
Error in ==> epanetloadfile at 31
Caused by: Error using ==> feval Undefined function or variable 'epanet2_proto'. } ... Matlab M-code Stack Trace ... file C:\Program Files\MATLAB\R2010b\toolbox\compiler\mcr\matlab\general\loadlibrary.m, name loadlibrary, line 477. file C:\Users\AUG\AppData\Local\Temp\AUG\mcrCache7.14\Source12\SourceTrace\epanetloadfile.m, name epanetloadfile, line 31. com.mathworks.toolbox.javabuilder.MWException: Error using ==> loadlibrary at 477 There was an error loading the library "C:\Users\AUG\Documents\Backup\SourceTracing\epanet2.dll" Undefined function or variable 'epanet2_proto'. at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclFeval(Native Method) at com.mathworks.toolbox.javabuilder.internal.MWMCR.access$600(MWMCR.java:23) at com.mathworks.toolbox.javabuilder.internal.MWMCR$6.mclFeval(MWMCR.java:902) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.mathworks.toolbox.javabuilder.internal.MWMCR$5.invoke(MWMCR.java:800) at $Proxy0.mclFeval(Unknown Source) at com.mathworks.toolbox.javabuilder.internal.MWMCR.invoke(MWMCR.java:475) at SourceTrace.SourceTrace.epanetloadfile(SourceTrace.java:580) at leakdetection.water.source.tracing.Test.<init>(Test.java:46) at leakdetection.water.source.tracing.Test.main(Test.java:19) BUILD SUCCESSFUL (total time: 13 seconds)
Respuesta aceptada
Más respuestas (1)
Kaustubha Govind
el 11 de Jul. de 2011
As the error suggests:
Undefined function or variable 'epanet2_proto'
You need to add the prototype file epanet2_proto.m to the archive (add it under "Additional Files" if using DEPLOYTOOL or append using -a option if using MCC).
Categorías
Más información sobre Java Package Integration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!