

![]() | 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: |
2 messages in net.java.dev.jna.usersRe: Very odd JNA behaviour| From | Sent On | Attachments |
|---|---|---|
| LYou...@gkservices.com | Jun 4, 2008 11:47 am | |
| Mikel Cármenes Cavia | Jun 4, 2008 11:56 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: Very odd JNA behaviour | Actions... |
|---|---|---|
| From: | LYou...@gkservices.com (LYou...@gkservices.com) | |
| Date: | Jun 4, 2008 11:47:24 am | |
| List: | net.java.dev.jna.users | |
I am suspecting something with the DLL building, there is I think old and new DLL options. Something to do with name mangling or meta data etc.
I use MinGW to build the DLL files so that I have at least the 'sense' whether it's true or not that I have more control over what goes on with the building of the DLL.
----------------------------------------------------------------------
----- Message from Mikel Cármenes Cavia <mik...@greenimaging.com> on Wed, 04 Jun 2008 15:01:52 -0300 ----- To: use...@jna.dev.java.net Subject: Very odd JNA behaviour.
Hey guys,
I am writing in to the list as my last resort, after having spent a good few hours trying to figure out what the issue is.
Basically, I am making use of JNA to link a Java application to a DLL file, which contains a mathematical algorithm to compute stuff. GIven that I was unable to talk to it directly (issues with entry points and whatnot), I proceeded to create a C file, which I subsequently compiled into a DLL that wraps around the original DLL. This process works like a charm in my development machine: I added the JNA.jar file, set the jna.library.path property accordingly, and I was readily able to access the method in the wrapper DLL, through the following interface:
public interface CurviLibrary extends Library { CurviLibrary CurviInitialization = (CurviLibrary) Native.loadLibrary("Curvi",CurviLibrary.class); CurviLibrary OptimizedSolver = (CurviLibrary) Native.loadLibrary("OptimizedSolver",CurviLibrary.class); DoubleByReference GIT_CURVIG(float[] timeData, float[] rawData, float[] relax, int rawDataSize, double alphaValue, long numberOfBins); }
Everything was nice and good, until I committed all of my code and tried to execute the same functionality in a different machine.
It turns out that the exact same IDE, running the exact same version of the code, with all the jar's and dll's in place, cannot function correctly with JNA and the wrapper DLL. I've even gone as far as creating a simple dll containing a mere cout statement, and that won't even work in this other machine. So essentially, not only will it not work for the whole functionality, but it doesn't even seem to work for simple stuff like loading a dll and executing a single void method.
So, in a nutshell, I'm not exactly sure as to what I need help with. I used Visual C++ 2008 Express Edition to create the DLL's (except for the original DLL that I wrap around, which I was given).
Any clues as to where to tackle this problem?
Thanks so much in advance, I look forward to reading everyone's responses.
Cheers,
Mikel
Levi Yourchuck Senior Programmer Analyst G&K Services Phone: 952 912 5828 www.gkservices.com Enhancing Image & Safety Through Innovation This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal.







