I’m in the process of upgrading my extension to support SU2025 PBR materials.
I successfully updated my extension, and it works fine in SU2025. I noticed I’m having issues loading my extension in older SketchUp versions (SU 2024 and SU 2023). Is the latest SDK supposed to work with older SketchUp versions ( SketchUp API 13.0, SketchUp 2025.0). I could not find it in the release notes: SketchUp C API: SketchUp C API Release Notes
The previous SDK was compatible with older versions because I could support SU2024, SU2023, and SU2022 with a single build.
And looking at dependency walker, it seems that the DLL is not missing any downstream dependencies (except for Ruby, which I assume is loaded when running SU?):
This error message usually means that the entry point function in the compiled so, dll, dylib or bundle cannot be found by Ruby. If you are using Ruby’s require method, then there must be an entry point function named Init_SUEX_Rayscaper(), (i.e., the prefix Init_ followed by the library filename minus the extension.)
The plugin works just fine with SU2025; it fails when I try it on SU2024. It worked before the upgrade to the latest SDK on SU2022, SU2023, SU2024 and SU2025.
My next suggestion would be to look at the targeted toolkit setting in MSVS.
However, it appears that the C SDK documentation intro page has not been updated for 2024 and 2025 releases in this regard.
Ruby DLL’s name is different in SU 2023, which would explain why a build for 2025 won’t work there. But I’m not sure why it doesn’t work in 2024 (which has the same Ruby DLL I believe)
To clarify on the Ruby versions, I’m building two DLLs of my C extensions. One targeting Ruby 2.7 (x64-msvcrt-ruby270.lib - SU 2023/2022) and the other one targeting Ruby 3.2 (x64-ucrt-ruby320.lib - SU2024/SU2025). Based on the SketchUp version, I’m copying the correct dll in my plugin directory and load it from there.
There is a system flag we can enable that will cause the kernel to log the diagnostic information created by a failed loadlibrary call. The flag is referred to as Show Loader Snaps (SLS) Show Loader Snaps - Windows drivers | Microsoft Learn. The SLS flag is enabled by a tool called gflags.exe GFlags - Windows drivers | Microsoft Learn which is part of the Debugging Tools for Windows and would have been installed on you computer as part of Visual Studio.
Summarizing the comments from a short discussion of using gflags.exe on this Stackoverflow page.
The Microsoft gflags tool will always tell you exactly what dependency is failing to load and why.
Run gflags -i your_application.exe +sls. After that execute the application under the debugger to capture the loader traces.
.
. debug you application
.
Run gflags -i your_application.exe -sls afterwards to disable the loader traces.
Below are the steps to use gflags to diagnose problems with your SUEX_rayscraper.so file.
Disable Rayscraper in SU2024
To Enable the Show Loader Snaps flag
Open a Command Prompt
cd C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
gflags -i sketchup.exe +sls
Start windbg.exe
File>Open Executable
Navigate to Sketchup.exe
The debugger will load Sketchup and stop at the entry point
Press F5 to complete loading Sketchup.
At this point you can either enable the Rayscraper extension or
require ‘path/path/SUEX_Rayscraper.so’ in the Ruby Console
The loader failure information will be logged to the windbg console.
Disable the Show Loader Snaps flag
gflags -i sketchup.exe -sls