I changed my function to __stdcall
extern "C" __declspec(dllexport)int __stdcall subscribe(int foo);
int __stdcall subscribe(int foo)
{
return 0;
}
and I changed my java interface to extend Library
Now I am getting -
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot locate
function 'subscribe'
On 6/14/07, Timothy Wall <twal...@dev.java.net> wrote:
On Jun 14, 2007, at 2:32 PM, Daniel Horowitz wrote:
Timothy,
I am. Here is my java interface.
import com.sun.jna.*;
import com.sun.jna.win32.*;
public interface GTAPI32 extends StdCallLibrary {
Here are my dll function definitions. all the functions work except
subscribe.
#ifndef _TESTAPIB_H_
#define _TESTAPIB_H_
extern "C" __declspec(dllexport)int init();
In that case it's probably your library that isn't declaring its
functions as being stdcall, and you should derive from Library rather
than StdCallLibrary. I believe the default calling convention is
cdecl, even with MSVC. The declspec above typically only tags the
function for export. You still need a __stdcall attribute if that's
the type of convention you want for it.