SketchUp 2025 C SDK Compatibility

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.

Regards,
Thomas

The SDK should be compatible.

Can you provide with some more specific details to what you’re running into?

In SketchUp 2024, I get the following error in the Ruby console when my plugin is compiled with the SDK (2025-0-571):

Running rayscaper mode=Debug, paths=["C:/Users/Thomas/dev/RayscaperBuilds/Debug/", "C:/Users/Thomas/dev/sketchup-ruby-api-tutorials"]

Globbing path: C:/Users/Thomas/dev/RayscaperBuilds/Debug/, path.encoding UTF-8

Exists? true

Loading Rayscaper 0.9.44 Beta...

Force installing Rayscaper: true.

Loading failed: 127: The specified procedure could not be found. - C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/installed/Windows/3.2.2/0.9.44 Beta/resources/SUEX_Rayscaper.so

Successfully required: C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb

Globbing path: C:/Users/Thomas/dev/sketchup-ruby-api-tutorials, path.encoding UTF-8

Exists? true

Error: #<LoadError: 126: The specified module could not be found. - C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/installed/Windows/3.2.2/0.9.44 Beta/resources/SUEX_Rayscaper.so>

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/extension_controller.rb:4:in `require_relative'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/extension_controller.rb:4:in `<top (required)>'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/main.rb:110:in `require'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/main.rb:110:in `<module:Rayscaper>'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/main.rb:5:in `<top (required)>'

C:/Program Files/SketchUp/SketchUp 2024/Tools/extensions.rb:197:in `require'

C:/Program Files/SketchUp/SketchUp 2024/Tools/extensions.rb:197:in `load'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb:18:in `register_extension'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb:18:in `<module:Rayscaper>'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb:6:in `<top (required)>'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:32:in `require'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:32:in `block (2 levels) in <top (required)>'

<internal:dir>:220:in `glob'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:31:in `block in <top (required)>'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:26:in `each'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:26:in `<top (required)>'

Error: #<NameError: uninitialized constant Rayscaper::SUEX_Rayscaper>

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/main.rb:113:in `<module:Rayscaper>'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper/main.rb:5:in `<top (required)>'

C:/Program Files/SketchUp/SketchUp 2024/Tools/extensions.rb:197:in `require'

C:/Program Files/SketchUp/SketchUp 2024/Tools/extensions.rb:197:in `load'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb:18:in `register_extension'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb:18:in `<module:Rayscaper>'

C:/Users/Thomas/dev/RayscaperBuilds/Debug/rayscaper.rb:6:in `<top (required)>'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:32:in `require'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:32:in `block (2 levels) in <top (required)>'

<internal:dir>:220:in `glob'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:31:in `block in <top (required)>'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:26:in `each'

C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/!external.rb:26:in `<top (required)>'

The DLL is actually in the correct location:

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?):

If it helps, I can send you my plugin without encrypted Ruby code so you can try for yourself.

Thanks for your help!

Cheers,
Thomas

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 symbol Init_SUEX_Rayscaper() is definitely there:

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.

Regards,
Thomas

Anything else I can provide, or something else I can look at to help me debug this problem? Any help is appreciated!

Thanks,
Thomas

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.


pinging: @tt_su @bugra @CraigTrickett

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)

Thanks for the suggestions.

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.

This has always worked for me so far.

Greetings Thomas,

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