Can't compile SDK DevelopersGuide C examples on macOS Big Sur

I downloaded the LO 7.1.2 SDK and attempted to build several of the DevelopersGuide examples on macOS Big Sur 11.2.3. The Java examples seemed to build and run fine. But when I try to build and run the ProfUnoLifetime.runexe C++ example, I get this error:

Hematite:Lifetime chucko$ make ProfUnoLifetime.runexe
mkdir -p /Users/chucko/bin/LibreOffice7.1_SDK/MACOSXexample.out/misc
rm -f /Users/chucko/bin/LibreOffice7.1_SDK/MACOSXexample.out/misc/oosdk_cpp_types.flag
“/opt/LibreOffice/SDK/LibreOffice7.1_SDK/bin/cppumaker” -Gc -O/Users/chucko/bin/LibreOffice7.1_SDK/MACOSXexample.out/inc “/Applications/LibreOffice.app/Contents/Resources/ure/share/misc/types.rdb” “/Applications/LibreOffice.app/Contents/MacOS/…/Resources/types/offapi.rdb”
dyld: Library not loaded: @VIA_LIBRARY_PATH/libunoidllo.dylib
Referenced from: /opt/LibreOffice/SDK/LibreOffice7.1_SDK/bin/cppumaker
Reason: unsafe use of relative rpath @VIA_LIBRARY_PATH/libunoidllo.dylib in /opt/LibreOffice/SDK/LibreOffice7.1_SDK/bin/cppumaker with restricted binary
make: *** [/Users/chucko/bin/LibreOffice7.1_SDK/MACOSXexample.out/misc/oosdk_cpp_types.flag] Abort trap: 6
Hematite:Lifetime chucko$

At first I thought this was an environment issue; the setsdkenv_unix script was setting DYLD_LIBRARY_PATH, but the subshell it spawned didn’t inherit that variable. So I explicitly set it myself. But the problem didn’t change.

I tried to fix the references to the libraries with install_name_tool, but it warned me that this would invalidate the code signature.

I can’t see a way to fix this myself with Apple’s security policies in place, except maybe by building LO and the SDK from source.

It seems of the executables in the LibreOffice7.1_SDK/bin directory, cppumaker, idlc, javamaker, uno-skeletonmaker, and unoidl-check all refer to libraries in the library path. That suggests it will be impossible to do anything with Uno IDL on macOS.

Does anyone have a way around this problem? (Other than switching to Linux, that is.)

Your question is actually off-topic here, because this site is for questions and answers about LibreOffice usage. Development issues are to be discussed on IRC and mailing lists (and you’ll get quicker answers).

@gabix: The SDK is used for macros, so it doesn’t necessarily seem off-topic to me. It looks like the question is about how to get the C++ examples to work at LibreOffice 6.4 SDK - Developer's Guide Examples.

I’ve done this on Windows and Linux but not with MacOS. Not sure if there is anyone who frequents this site and has worked with C++ macros on a Mac.