hzzc1987 / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Conversion Error : WINAPI #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
hello, i am getting the below error in the generated native declaration 
"Conversion Error : WINAPI"

native declaration : 
D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi.h:693
Conversion Error : WINAPI

native declaration : 
D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi.h:709
Conversion Error : WINAPI

D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi.h:728
Conversion Error : WINAPI
...etc

java -jar jnaerator-0.9.4.jar -preferJavac  -direct -beanStructs -package 
com.crossmatch.lscan -library LScanEssentials 
D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\ImageData.h 
D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi_defs.h 
D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi_err.h 
D:\SaM\Projects\mcgeorgeconsulting\crossmatch\API\LScanEssentialsApi.h

moreover when i check my DLL file i see the "@" symbol at the end of each 
method declaration that is causing "java.lang.UnsatisfiedLinkError: Error 
looking up function" for all of the converted methods.

any ideas how to make a workaround?

I attached the header files

thanks

Original issue reported on code.google.com by sameeh.h...@gmail.com on 7 Aug 2010 at 11:02

Attachments:

GoogleCodeExporter commented 8 years ago
Hello,

You either need to include the appropriate headers or define WINAPI as an empty 
macro (-DWINAPI=) or as some export modifier (-DWINAPI=__stdcall).

I suggest you read this thread for an example of including a Windows header 
(WinReg.h) :

https://jna.dev.java.net/servlets/ReadMsg?list=users&msgNo=4165

For the UnsatisfiedLinkError, did you use the JNAerated loading code ? 

NativeLibrary.getInstance(MyLibrary.JNA_LIBRARY_NAME,  
MangledFunctionMapper.DEFAULT_OPTIONS)

If not, you'll need to use an StdCallFunctionMapper by yourself.

Cheers

Original comment by olivier.chafik@gmail.com on 9 Aug 2010 at 9:31

GoogleCodeExporter commented 8 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/149

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:25