Bug 141896 - SDK example DocumentLoader complains about the lack of /libmergedlo.so
Summary: SDK example DocumentLoader complains about the lack of /libmergedlo.so
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
7.1.1.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-25 22:02 UTC by Hossein
Modified: 2025-09-17 10:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2021-04-25 22:02:24 UTC
To reproduce the problem, do the following steps:

1. Install LibreOffice 7.1 and SDK.
2. cd /opt/libreoffice7.1/sdk/
3. ./setsdkenv_unix
4. cd examples/cpp/DocumentLoader/
5. make DocumentLoader.run

It complains about the lack of /libmergedlo.so:

loading component library </libmergedlo.so> failed /home/buildslave/source/libo-core/cppuhelper/source/shlib.cxx:298

I have tested this with LibreOffice 7.0 and its SDK, and the problem was just the same. Upon creating a symbolic link from the appropriate library file to /libmergedlo.so things will be fine.

Things are fine when working with compiled LibreOffice git master.

The problem is not limited to this specific SDK example. I have written a short DOCX->PDF conversion program with C++, and I had the exact same error when executing this line:

xInterface = Reference<XInterface>(resolver->resolve(sConnectionString), UNO_QUERY );
Comment 1 Buovjaga 2021-04-27 08:41:54 UTC
In the chat we discussed this and I could not reproduce with the Arch package https://archlinux.org/packages/extra/x86_64/libreoffice-fresh-sdk/
Comment 2 Hossein 2021-04-27 09:05:48 UTC
Thank you for testing. I have this problem in Ubuntu 20.04 using the official DEB packages from 

https://download.documentfoundation.org/libreoffice/stable/7.0.5/deb/x86_64/
LibreOffice_7.0.5_Linux_x86-64_deb.tar.gz
LibreOffice_7.0.5_Linux_x86-64_deb_sdk.tar.gz

https://download.documentfoundation.org/libreoffice/stable/7.1.1/deb/x86_64/
LibreOffice_7.1.1_Linux_x86-64_deb.tar.gz
LibreOffice_7.1.1_Linux_x86-64_deb_sdk.tar.gz
Comment 3 Hossein 2021-05-08 23:35:24 UTC
By setting "bootstrap variables", the problem goes away.

Using shell script, URE_BOOTSTRAP environment variable can be set:

export URE_BOOTSTRAP=vnd.sun.star.pathname:/opt/libreoffice7.1/program/fundamentalrc

In C++ code, one can use:

Bootstrap::set("URE_BOOTSTRAP", "vnd.sun.star.pathname:/opt/libreoffice7.1/program/fundamentalrc");

It should be noted that in the latest build of LO master, I do not have such problem. Even in that situation, setsdkenv_unix does not set URE_BOOTSTRAP.

Some information about the bootstrap settings for applications can be read here:

/opt/libreoffice7.1/sdk/include/rtl/bootstrap.h
Comment 4 Hossein 2021-06-26 16:10:21 UTC
Tested on Windows 10, and the same problem exists.

One need to set this variable to fix the problem:

SET URE_BOOTSTRAP=vnd.sun.star.pathname:C:/Progra~1/LibreOffice/program/fundamental.ini

Otherwise, setsdkenv_windows.bat does not properly set this environment variable. (I set the compiler via Microsoft scripts)

To reproduce, do these steps for LibreOffice x64 on Windows 10 with VS 2019 and Cygwin64 installed:

> cd C:\Program Files\LibreOffice\sdk
> setsdkenv_windows.bat
 ******************************************************************
 *
 * SDK environment is prepared for Windows
 *
 * SDK = c:\progra~1\Libreoffice\sdk
 * Office = c:\progra~1\Libreoffice
 * Make = C:\cygwin64\bin
 * Zip = C:\cygwin64\bin
 * cat = C:\cygwin64\bin
 * sed = C:\cygwin64\bin
 * C++ Compiler =
 * C# and VB.NET compilers =
 * Java =
 * Special Output directory = c:\libreoffice7.1_sdk
 * Auto deployment = YES
 *
 ******************************************************************
> set|grep UNO
UNO_PATH=c:\progra~1\Libreoffice\program

> cd examples\cpp\DocumentLoader
> %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
> make
> c:\libreoffice7.1_sdk\WINexample.out\bin\DocumentLoader.exe -env:URE_MORE_TYPES="file:///C:/Progra~1/LibreOffice/program/types/offapi.rdb" test.odt

Error: cannot establish a connection using 'uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager':
       loading component library </mergedlo.dll> failed

> SET URE_BOOTSTRAP=vnd.sun.star.pathname:C:/Progra~1/LibreOffice/program/fundamental.ini

> c:\libreoffice7.1_sdk\WINexample.out\bin\DocumentLoader.exe -env:URE_MORE_TYPES="file:///C:/Progra~1/LibreOffice/program/types/offapi.rdb" test.odt

So, by setting URE_BOOTSTRAP environment variable manually, everything will be OK.
Comment 5 Hossein 2021-09-13 18:48:56 UTC
This seems to be a confirmation of this bug:

https://lists.freedesktop.org/archives/libreoffice/2021-July/087617.html
Comment 6 Hossein 2021-09-13 21:08:04 UTC
This is fixed in LibreOffice 7.2.0

Works fine in:

Version: 7.2.0.4 / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Hossein 2021-09-14 15:31:31 UTC
The problem is still there with 7.2.0.4 on Windows.

Version: 7.2.0.4 (x64) / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 8 QA Administrators 2023-09-17 03:05:49 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2025-09-17 03:09:46 UTC Comment hidden (obsolete)
Comment 10 Hossein 2025-09-17 10:35:26 UTC
I no longer face this issue, therefore I close down this bug as WORKSFORME.

LO SDK works as expected with LO 25.8 on Linux:
Version: 25.8.1.1 (X86_64)
Build ID: 54047653041915e595ad4e45cccea684809c77b5
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

And also with 25.2 on Windows:
Version: 25.2.6.2 (X86_64) / LibreOffice Community
Build ID: 729c5bfe710f5eb71ed3bbde9e06a6065e9c6c5d
CPU threads: 20; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

On the other hand, now I receive somehow similar issues on macOS, in which I will file in another bug report.