Thank you very much!<br><br><p>At 2023-06-19 21:02:05, "Stéphane Guillou" <stephane.guillou@libreoffice.org> wrote:</p><blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="moz-cite-prefix">Hi Jingze,</div>
<div class="moz-cite-prefix">This is the Quality Assurance mailing
list. For questions and answers, please use
<a class="moz-txt-link-freetext" href="https://ask.libreoffice.org/">https://ask.libreoffice.org/</a></div>
<div class="moz-cite-prefix">However, given that your question is
about programming, you might get more answers on the dev mailing
list: <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/libreoffice">https://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thank you!</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 19/06/2023 11:40, Jingze Xu wrote:<br>
</div>
<blockquote type="cite" cite="mid:2e8cad7b.45e4.188d3073a5e.Coremail.qdxujingze18@126.com">
<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">
<div style="margin:0;">Dear all, </div>
<div style="margin:0;">Hi, I'm new to libreoffice and its forum.
I have a question but I am not sure where to ask. If this is
the right place, here is the question :)</div>
<div style="margin:0;"><br>
</div>
<div style="margin:0;">---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div style="margin:0;">Question:</div>
<div style="margin:0;">I have successfully added a new dialog in
Impress according to the steps in this tutorial - <a href="https://wiki.documentfoundation.org/Development/Create_new_dialog_in_Impress" moz-do-not-send="true">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:0;">I have an external library <b>libxxx</b>
containing some C++ header files and a .so file. I put the
header files in <span style="font-family: Courier;">include/</span>
folder and .so file outside libreoffice directory. I include
the header files of this library in dialog source files
located in <span style="font-family: Courier;">sd/source/ui/dlg</span>.
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:0;"><br>
</div>
<div style="margin:0;"><span style="font-family: Courier;">./autogen.sh LDFLAGS=-L/path_to_libxxx
LIBS=-lxxx</span></div>
<div style="margin:0;"><br>
</div>
<div style="margin:0;">Then I rebuild the sd module using <span style="font-family: Courier;">make sd</span>, however, it
seems the functions in .so library is not properly linked. </div>
<div style="margin:0;"><br>
</div>
<div style="margin:0;">
<div style="margin:0;"><span style="font-size: 10px;">"/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:0;"><span style="font-size: 10px;">HelloDialog.cxx:(.text+0x36c):
<span style="font-size: 10px; color: rgb(221, 64, 50);">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:0;"><span style="font-size: 10px;">collect2:
error: ld returned 1 exit status</span></div>
<div style="margin:0;"><span style="font-size: 10px;">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:0;"><span style="font-size: 10px;">make:
*** [Makefile:121: sd] Error 2"</span></div>
<div><br>
</div>
<div>Are there some clues about linking so library in
libreoffice codebase?</div>
<div>Thanks!</div>
<div>---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div><br>
</div>
<div>If this is not the right place to ask questions, I'm
sorry about this and please tell me where to ask questions.
Thanks!</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jingze Xu</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Stéphane Guillou
Quality Assurance Analyst | The Document Foundation
Email: <a class="moz-txt-link-abbreviated" href="mailto:stephane.guillou@libreoffice.org">stephane.guillou@libreoffice.org</a>
Mobile (France): +33 7 79 67 18 72
Matrix: @stragu:matrix.org
Fediverse: @stragu@mastodon.indie.host
Web: <a class="moz-txt-link-freetext" href="https://stragu.gitlab.io/">https://stragu.gitlab.io/</a></pre>
</blockquote>