

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in net.java.dev.jna.usersRe: [jna-users] Using multiple libraries| From | Sent On | Attachments |
|---|---|---|
| Felipe Armoni, felipe.armoni | May 20, 2009 7:32 am | |
| Jorge Nto | May 20, 2009 8:11 am | |
| Timothy Wall | May 20, 2009 11:55 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Using multiple libraries | Actions... |
|---|---|---|
| From: | Jorge Nto (jorg...@gmail.com) | |
| Date: | May 20, 2009 8:11:09 am | |
| List: | net.java.dev.jna.users | |
Bom dia Felipe!
Porque nao simplesmente cola a sua dll na misma pasta que o suo projeto. Eu tinha o mismo problema que você.
Até mais,
Jorge
On Wed, May 20, 2009 at 4:33 PM, Felipe Armoni, felipe.armoni < farm...@itautec.com> wrote:
Hi,
I am developing a managed .dll in Visual C++ that has several other dlls as its dependencies. After I compiled it, I created a lib folder in my Java Eclipse project and put my dll and all the other dependencies inside it.
My first problem is that whenever I have to access my dll I need to provide the full system path, I cannot just write its name. Therefore the statement below works: *
public * Lumidigm *INSTANCE* = (Lumidigm) Native.*loadLibrary*("C:\\Itautec\\Central Biometrica\\Java\\LumidigmSensor\\lib\\Lumidigm\\LumidigmHelper.dll", Lumidigm.*class*); But this other statement throws the following exception: *
public * Lumidigm *INSTANCE* = (Lumidigm) Native.*loadLibrary*( "LumidigmHelper.dll", Lumidigm.*class*);
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library '\lib\Lumidigm\LumidigmHelper.dll': Não foi possível encontrar o módulo especificado.
at com.sun.jna.NativeLibrary.loadLibrary( *NativeLibrary.java:145*)
at com.sun.jna.NativeLibrary.getInstance( *NativeLibrary.java:188*)
at com.sun.jna.Library$Handler.<init>( *Library.java:123*)
at com.sun.jna.Native.loadLibrary( *Native.java:255*)
at com.sun.jna.Native.loadLibrary( *Native.java:241*)
at br.com.itautec.centralbiometrica.nativeInterfaces.lumidigm.Lumidigm.<clinit>( *Lumidigm.java:12*)
at br.com.itautec.innovatricsEngine.Program.main( *Program.java:34*) The dll's path is <project folder>\lib\Lumidigm. Do I have to include this path on the classpath for this to work? If so how can I do that with Eclipse?
My second problem is that I am trying to put some logging inside my dll and I am using the log4net api to do it. The thing is that I keep getting the error below:
# # An unexpected error has been detected by Java Runtime Environment: # # Internal Error (0xe0434f4d), pid=3772, tid=468 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing) # Problematic frame: # C [kernel32.dll+0x12a5b] # # An error report file with more information is saved as hs_err_pid3772.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp #
I think that this is because the dll is not finding the log4net.xml or the log4net.dll, but I am not sure. I have tested this dll with another C++ program and it worked fine, plus all the required dlls and xmls are in the same folder as my dll.
Do any of you have a recommendation as what I should do? Does anyone uses logging in their dlls? Should I continue to use log4net or do you recommend another api?
I also thought about making all of my functions return a char* with the logging information, this way I could log everything in the java program using log4j, although this seems like a rather dirty solution to me...
Thank you all, Felipe







