PDA

View Full Version : java to DLL function name mapping error?


Peltito
07-31-2003, 06:08 PM
Hey guys,

I've been bothering Stuka in the java forum but I decided since I've kinda moved out of the java arena and am now wandering kinda in between that I'd bother you guys. Sorry... =P

Anyway, my problem is this. I'm attempting to access a PCI card that controls some encoders through a java App. In order to do this I had to implement the 'native' functions in a file (called cardInterface) and then use the command 'javah' to create a C/C++ .h file. I copy and paste the .h file to a .cpp file and flesh out the functions. After doing this I use the 'cl' command and a c/c++ compiler to compile the .cpp/.h files into a dll. That being done, I load the .dll in my java file (cardInterface).

Whew. Ok, here's where it breaks down. When my program starts, it loads up the GUI and the library just fine. When it goes to call the first function (initialize to initialize the card) it gives me an UnsatisfiedLinkError. I looked this stuff up in the java help pages (the only documentation I knew of) and it says it is because the library couldn't find the function. But if most of the stuff, including the method names, are machine generated and all this is done on the same machine why doesn't it work?

Please.... please help... I'm at the end of my pitiful rope.:(

Thanks.:D