Need help with linker error
Milian Wolff
mail at milianw.de
Mon Apr 6 20:36:00 UTC 2009
On Monday 06 April 2009, Milian Wolff wrote:
> On Sunday 05 April 2009, Andreas Pakulat wrote:
> > On 05.04.09 21:50:17, Milian Wolff wrote:
> > > Hi guys!
> > >
> > > I just stumbled upon an error I cannot resolve...
> > >
> > > I can't use any functions (note: not methods, plain functions!) from
> > > php/duchain/helper.h inside completion/context.cpp...
> > >
> > > I've added helper.h as an #include yet the linker complains about an
> > > undefined reference...
> > >
> > > The library (i.e. the cmake target) containing helper.cpp is definitly
> > > linked to. What I think the error is:
> > >
> > > objdump -t libkdev4phpduchain.so | grep -i findDeclarationImport
> > > 0006275d l F .text 00000a5a .hidden
> > > _ZN3Php27findDeclarationImportHelperEPN8KDevelop9DUContextENS0_19Qualif
> > >ie dIdentifierENS_15DeclarationTypeEPNS_7AstNodeEPNS_16EditorIntegratorE
> > >
> > > Note the .hidden - how can I remove that? I tried the
> > > KDEVPHPDUCHAIN_EXPORT makro on the function but only get
> > >
> > > In file included from
> > > /home/milian/projects/kde4/php/duchain/includebuilder.cpp:23:
> > > /home/milian/projects/kde4/php/duchain/helper.h:50: warning:
> > > ‘visibility’ attribute ignored on non-class types
> > >
> > > So I'm lost... What do I have to do to get that function workin in
> > > other places?
> >
> > You definetly need to add the export macro, how did you add that? The
> > line should be:
> >
> > KDEVPHPDUCHAIN_EXPORT KDevelop::Declaration*
> > findDeclarationImportHelper(KDevelop::DUContext* currentContext,
> >
> > After that the symbol shouldn't be hidden anymore, the error message
> > from gcc suggests that you added it at the end or something (at least
> > here line 50 is the last line of the method).
> >
> > Andreas
>
> I put it after the return type... will check again tomorrow. Thanks for the
> heads up!
Works like a charm, thanks Andreas!
--
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090406/5f7937ae/attachment.sig>
More information about the KDevelop-devel
mailing list