Are you linking against sketchup.lib
or SketchUpAPI.lib? The former links to the C API within Sketchup.exe, the latter links against the standalone version. Mixing those two doesn’t work well.
If you need to use features from the C API released with SU2018 with older versions you have to look into some other way of communicating with the C API.
I’m afraid that function was neglected for a long time so it’s not reliable for older versions I’m afraid.
That should be fine - the main thing to keep in mind is that if you link against the version of the SDK that SketchUp shipped with (sketchup.lib) then you must be careful not to call new functions from older versions.
An alternative you can try is to make a CLI executable that links against the standalone C API. If you only use the SDK to write SKP files it shouldn’t be that much more work to get it working - call your executable with an output path.
If you use the SDK to read from a live model then that becomes a challenge.