<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><blockquote type="cite" cite="mid:2e8cad7b.45e4.188d3073a5e.Coremail.qdxujingze18@126.com" style="margin-right: 0px; font-family: Helvetica, "Microsoft Yahei", verdana; word-break: break-word !important;"><div style="line-height: 1.7; font-family: Arial; word-break: break-word !important;"><div style="margin: 0px; word-break: break-word !important;">Dear all, </div><div style="margin: 0px; word-break: break-word !important;">Hi, I have a question about linking .so libraries. </div><div style="margin: 0px; word-break: break-word !important;"><br style="word-break: break-word !important;"></div><div style="margin: 0px; word-break: break-word !important;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div><div style="margin: 0px; word-break: break-word !important;">Question:</div><div style="margin: 0px; word-break: break-word !important;">I have successfully added a new dialog in Impress according to the steps in this tutorial - <a moz-do-not-send="true" href="https://wiki.documentfoundation.org/Development/Create_new_dialog_in_Impress" style="color: rgb(41, 158, 89); word-break: break-word !important;">Development/Create new dialog in Impress - The Document Foundation Wiki</a>. Now I wish to call functions in an external library in the dialog source file.</div><div style="margin: 0px; word-break: break-word !important;">I have an external library <b style="word-break: break-word !important;">libxxx</b> containing some C++ header files and a .so file. I put the header files in a subfolder in <span style="font-family: Courier; word-break: break-word !important;">include/</span> folder and .so file outside libreoffice directory. And I include the header files in dialog source files located in <span style="font-family: Courier; word-break: break-word !important;">sd/source/ui/dlg</span>. Then I rerun the autogen.sh with extra arguments, trying to let the build system know I have a .so library to link. </div><div style="margin: 0px; word-break: break-word !important;"><br style="word-break: break-word !important;"></div><div style="margin: 0px; word-break: break-word !important;"><span style="font-family: Courier; word-break: break-word !important;">./autogen.sh LDFLAGS=-L/path_to_libxxx LIBS=-lxxx</span></div><div style="margin: 0px; word-break: break-word !important;"><br style="word-break: break-word !important;"></div><div style="margin: 0px; word-break: break-word !important;">I rebuild the sd module using <span style="font-family: Courier; word-break: break-word !important;">make sd</span>, however, it seems the functions in .so library is not properly linked. </div><div style="margin: 0px; word-break: break-word !important;"><br style="word-break: break-word !important;"></div><div style="margin: 0px; word-break: break-word !important;"><div style="margin: 0px; word-break: break-word !important;"><span style="font-size: 10px; word-break: break-word !important;">"/usr/bin/ld: /home/jingze_xu/office/libreoffice-7.6.0.0.beta1/workdir/CxxObject/sd/source/ui/dlg/HelloDialog.o: in function `sd::SdHelloDialog::OKHdl(weld::Button&)':</span></div><div style="margin: 0px; word-break: break-word !important;"><span style="font-size: 10px; word-break: break-word !important;">HelloDialog.cxx:(.text+0x36c): <span style="color: rgb(221, 64, 50); word-break: break-word !important;">undefined reference to</span> `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)'</span></div><div style="margin: 0px; word-break: break-word !important;"><span style="font-size: 10px; word-break: break-word !important;">collect2: error: ld returned 1 exit status</span></div><div style="margin: 0px; word-break: break-word !important;"><span style="font-size: 10px; word-break: break-word !important;">make[1]: *** [/home/jingze_xu/office/libreoffice-7.6.0.0.beta1/sd/Library_sdui.mk:10: /home/jingze_xu/office/libreoffice-7.6.0.0.beta1/instdir/program/libsduilo.so] Error 1</span></div><div style="margin: 0px; word-break: break-word !important;"><span style="font-size: 10px; word-break: break-word !important;">make: *** [Makefile:121: sd] Error 2"</span></div><div style="word-break: break-word !important;"><br style="word-break: break-word !important;"></div><div style="word-break: break-word !important;">Are there any clues about linking .so libraries in libreoffice codebase?</div><div style="word-break: break-word !important;">Thanks!</div><div style="word-break: break-word !important;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div><div style="word-break: break-word !important;"><br></div><div style="word-break: break-word !important;"><br style="word-break: break-word !important;"></div><div style="word-break: break-word !important;">Best wishes,</div><div style="word-break: break-word !important;">Jingze Xu</div></div></div></blockquote></div>