Bug #47065

José Guilherme Vanz guilherme.sft at gmail.com
Wed Feb 6 20:05:07 PST 2013


Hi Markus

Yeap, your tip solved my problem.
Thank you for your explanation

All the best
:)


On 6 February 2013 23:24, Markus Mohrhard <markus.mohrhard at googlemail.com>wrote:

> Hey,
>
> 2013/2/7 José Guilherme Vanz <guilherme.sft at gmail.com>:
> > Hi
> > I started work in this bug. I created the first simple source file, just
> for
> > test.
> > My doubt is, is necessary add my source file in some config file?
> >
> > In my test I created a object of my thread in the docfile.cxx. Nothing
> > special...
> > When I build the module occours the following fail:
> >
> > [build LNK] Library/libsfxlo.so
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/docfile.o:
> > In function `SfxMedium::LockOrigFileOnDemand(unsigned char, unsigned
> char)':
> > /home/vanz/gitroot/libo/sfx2/source/doc/docfile.cxx:1188: undefined
> > reference to `salhelper::Thread::launch()'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/docfile.o:
> > In function `salhelper::Thread::operator delete(void*)':
> > /home/vanz/gitroot/libo/solver/unxlngx6.pro/inc/salhelper/thread.hxx:89:
> > undefined reference to `salhelper::SimpleReferenceObject::operator
> > delete(void*)'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/docfile.o:
> > In function `WatchFileThread::WatchFileThread(char const*)':
> > /home/vanz/gitroot/libo/sfx2/source/doc/watchfilethread.hxx:28: undefined
> > reference to `salhelper::Thread::Thread(char const*)'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/docfile.o:
> > In function `WatchFileThread::~WatchFileThread()':
> > /home/vanz/gitroot/libo/sfx2/source/doc/watchfilethread.hxx:25: undefined
> > reference to `salhelper::Thread::~Thread()'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/watchfilethread.o:(.data.rel.ro._ZTV15WatchFileThread[_ZTV15WatchFileThread]+0x28)
> :
> > undefined reference to `salhelper::Thread::run()'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/watchfilethread.o:(.data.rel.ro._ZTV15WatchFileThread[_ZTV15WatchFileThread]+0x30)
> :
> > undefined reference to `salhelper::Thread::onTerminated()'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/watchfilethread.o:(.data.rel.ro._ZTV15WatchFileThread[_ZTV15WatchFileThread]+0x80)
> :
> > undefined reference to `non-virtual thunk to salhelper::Thread::run()'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/watchfilethread.o:(.data.rel.ro._ZTV15WatchFileThread[_ZTV15WatchFileThread]+0x88)
> :
> > undefined reference to `non-virtual thunk to
> > salhelper::Thread::onTerminated()'
> > /home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/CxxObject/sfx2/source/doc/watchfilethread.o:(.data.rel.ro._ZTI15WatchFileThread[_ZTI15WatchFileThread]+0x10)
> :
> > undefined reference to `typeinfo for salhelper::Thread'
> > collect2: error: ld returned 1 exit status
> > make[1]: ***
> > [/home/vanz/gitroot/libo/workdir/
> unxlngx6.pro/LinkTarget/Library/libsfxlo.so]
> > Error 1
> > make: *** [sfx2] Error 2
> >
> > What is my error? The build creates a .so of the module ( [build LNK]
> > Library/libsfxlo.so ) ?
> >
> > Thank you!
> >
> >
> >
> > On 4 February 2013 11:35, Michael Stahl <mstahl at redhat.com> wrote:
> >>
> >> On 04/02/13 14:30, Jan Holesovsky wrote:
> >> > Regarding your question in the bug - LO has its own threading API, you
> >> > can use class Thread from sal/inc/osl/thread.hxx
> >> >
> >> >
> http://cgit.freedesktop.org/libreoffice/core/tree/sal/inc/osl/thread.hxx
> >> >
> >> > You basically want to derive your class SomeGoodNameThread: class
> Thread
> >> > {}; where you overload the virtual run(); method.
> >>
> >> no, you should not derive from osl::Thread but instead from
> >> salhelper::Thread which avoids some pitfalls automatically.
> >>
> >> salhelper/inc/salhelper/thread.hxx
> >>
> >
> >
>
>
> You should add salhelper to gb_Library_use_libraries in sfx2/Library_sfx.mk
>
> It seems that sfx2 is not yet depending on salhelper but it looks like
> there is no problem in linking against salhelper in sfx2. Since we are
> not mentioning salhelper linking fails because it can't find the
> symbols. I hope that helps you resolve your problems.
>
> Regards,
> Markus
>



-- 
Att. José Guilherme Vanz
br.linkedin.com/pub/josé-guilherme-vanz/51/b27/58b/<http://br.linkedin.com/pub/jos%C3%A9-guilherme-vanz/51/b27/58b/>
http://blog.pt-br.libreoffice.org/
https://groups.google.com/d/forum/openqg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130207/a4e287ec/attachment-0001.html>


More information about the LibreOffice mailing list