Bug 141896 - SDK example DocumentLoader complains about the lack of /libmergedlo.so
Summary: SDK example DocumentLoader complains about the lack of /libmergedlo.so
Status: NEW
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: 2023-09-17 03:05 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
Dear Hossein,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug