<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hey Michael,</p>
<p>It looks like you're building jextract yourself using a newer
version of LLVM than 13. Newer versions change the way anonymous
structs are named, which causes some issues for jextract. LLVM
13.0.0 is the version we use internally as well, so that version
should work.<br>
</p>
<p>Alternatively, you could download jextract from
<a class="moz-txt-link-freetext" href="https://jdk.java.net/jextract/">https://jdk.java.net/jextract/</a> That version also supports Java 22.</p>
<p>Jorn<br>
</p>
<div class="moz-cite-prefix">On 28/03/2024 02:13, Michael Ennen
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAOTPd650VyfJs1Hb2FxnjAqhNu_1CoJr7DnLpWTnfkuh=4MWLw@mail.gmail.com">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I am trying to run jextract thusly:</div>
<div><br>
</div>
<div>$env:JAVA_HOME = "C:\Program Files\Java\jdk-17"<br>
$jdk = "C:\Program Files\Java\jdk-22"<br>
$libclang = "C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Tools\Llvm\x64"<br>
$I = "C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0"<br>
$jextractDir = ".\target\jextract"<br>
if (-Not (Test-Path $jextractDir)) {<br>
git clone <a href="https://github.com/openjdk/jextract" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jextract</a>
$jextractDir<br>
}<br>
cd $jextractDir<br>
# $env:JAVA_HOME = $jdk<br>
./gradlew.bat -Pjdk22_home="$jdk" -Pllvm_home="$libclang"
verify<br>
cd ../..<br>
New-Alias -Name jextract -Value
"$jextractDir\build\jextract\bin\jextract.bat" -Force<br>
jextract --output target\classes --target-package
com.brcolow.winapi -D "WIN32_LEAN_AND_MEAN=1" -D "_AMD64_=1"
--include-function CLSIDFromString "$I\um\combaseapi.h"<br>
<br>
</div>
<div>This is on Windows 11.</div>
<div><br>
</div>
<div>I get the following error from jextract:</div>
<div><br>
</div>
<div>FATAL: Unexpected exception
org.openjdk.jextract.clang.TypeLayoutError: InvalidFieldName.
segment: org.openjdk.jextract.clang.Type@e637624f, fieldName:
struct (anonymous at C:\Program Files (x86)\Windows
Kits\10\Include\10.0.22621.0\um\winnt.h:6563:21) occurred</div>
<div><br>
</div>
<div>Any help would be greatly appreciated.</div>
<div><br>
</div>
<div>Thank you.<br>
</div>
<div><br>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div style="font-family:arial;font-size:small">Michael
Ennen</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>