Question about linking .so libraries

Jingze Xu qdxujingze18 at
Tue Jun 20 01:29:03 UTC 2023

Dear all, 
Hi, I have a question about linking .so libraries. 

I have successfully added a new dialog in Impress according to the steps in this tutorial - Development/Create new dialog in Impress - The Document Foundation Wiki. Now I wish to call functions in an external library in the dialog source file.
I have an external library libxxx containing some C++ header files and a .so file. I put the header files in a subfolder in include/ folder and .so file outside libreoffice directory. And I include the header files in dialog source files located in sd/source/ui/dlg. Then I rerun the with extra arguments, trying to let the build system know I have a .so library to link. 

./ LDFLAGS=-L/path_to_libxxx LIBS=-lxxx

I rebuild the sd module using make sd, however, it seems the functions in .so library is not properly linked. 

"/usr/bin/ld: /home/jingze_xu/office/libreoffice- in function `sd::SdHelloDialog::OKHdl(weld::Button&)':
HelloDialog.cxx:(.text+0x36c): undefined reference to `Add_FileHeader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned short)'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/jingze_xu/office/libreoffice- /home/jingze_xu/office/libreoffice-] Error 1
make: *** [Makefile:121: sd] Error 2"

Are there any clues about linking .so libraries in libreoffice codebase?

Best wishes,
Jingze Xu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list