[ltt-dev] linking ust with C++ code
Mathieu Desnoyers
compudj at krystal.dyndns.org
Mon Oct 17 11:11:25 EDT 2011
Yes, the "extern C" trick should allow you to get around most of
problems for 0.x UST. Please note that UST 2.0 allows to instrument c++
code, but unfortunately this is unsupported for UST 0.x. We should have
most of UST 2.0 working by the end of the week.
Best regards,
Mathieu
* Irina Guilman (irina.guilman at ericsson.com) wrote:
> I thought that's how you normally link c functions from c++.
>
> Another alternative is probably to have a dummy .c file which includes ust/marker.h and then in the Makefile indicate that dummy.c is required for compilation of your .cc or .cpp file
> ________________________________
> From: guven turgut [mailto:guventurgut at hotmail.com]
>
>
>
> I was able to get around this with the following extern statement around the marker.h include.
>
>
>
> extern "C"
>
> {
>
> #include <ust/marker.h>
>
> }
>
> Very wierd, thanks for the replies though.
>
> Have a nice weekend.
>
> -Guven
>
> > From: irina.guilman at ericsson.com
> > To: guventurgut at hotmail.com; ltt-dev at lists.casi.polymtl.ca
> > Date: Fri, 14 Oct 2011 17:01:43 -0400
> > Subject: RE: [ltt-dev] linking ust with C++ code
> >
> > You mean if you are calling from c++ code c functions ust_marker(...) and others?
> >
> > -----Original Message-----
> > From: GT [mailto:guventurgut at hotmail.com]
> > Sent: October-14-11 4:48 PM
> > To: ltt-dev at lists.casi.polymtl.ca
> > Subject: Re: [ltt-dev] linking ust with C++ code
> >
> > Irina Guilman <irina.guilman <at> ericsson.com> writes:
> >
> > >
> > > Which same issue?
> > >
> >
> >
> >
> > The undefined symbols when I go to link to the c++ app with ust lib's:
> >
> > undefined reference to `ust_marker_probe_cb(ust_marker const*, void*, ...)'
> >
> > undefined reference to `__ust_marker_empty_function(ust_marker const*, void*, void*, char const*, __va_list_tag (*) [1])'
> >
> >
> > This worked fine in previous version of ust for me. I am cross compiling for powerpc linux with windriver toolchain.
> >
> >
> > -Guven
> >
> >
> >
> > _______________________________________________
> > ltt-dev mailing list
> > ltt-dev at lists.casi.polymtl.ca
> > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list