I am trying to use Jextract of project panama jdk22-ea
When I run
jextract WinUser.h
Then I get the following error:
ERROR: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h:173:2: error: "No Target Architecture"
How can I use Jextract to get all functions from User32.dll?
It is easier to use jextract with your own header that sets up suitable target architecture definitions. Try
User32.hwhich simply contains:Then run jextract to determine all the symbols from your chosen header file as
ALL.sym:This gives 50,000+ linesof symbols - far too big to use if you compiled the extracted code. Instead, filter just to the definitions you plan to use by adding
--include-xyz ABCparameter per symbol. It is easier to save the included symbols into a separate file such asUser32.sym:Then run
jextractwith just the subset of symbols you need adding--include-xyz ABCor including the edited contents of@User32.sym:It may take a few iterations with copying lines from
ALL.symtoUser32.symto get the right subset of dependencies.