<div dir="ltr"><div>Awesome - that fixed it. Sorry for the noise.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 28, 2024 at 6:21 AM Jorn Vernee <<a href="mailto:jorn.vernee@oracle.com">jorn.vernee@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
  <div>
    <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 href="https://jdk.java.net/jextract/" target="_blank">https://jdk.java.net/jextract/</a> That version also supports Java 22.</p>
    <p>Jorn<br>
    </p>
    <div>On 28/03/2024 02:13, Michael Ennen
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <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" target="_blank">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">
            <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>
  </div>

</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small">Michael Ennen</div></div></div></div></div>