Is it possible to convince waf to use g++ for linking certain modules?

Thomas Nagy tnagy1024 at
Mon Mar 23 15:11:24 MDT 2015

On Mon, Mar 23, 2015 at 9:47 PM, Richard Sharpe wrote:
> Hi folks,
> I need to like some C++ generated code to a Samba module (protobufs
> stuff) and I am having problems with undefined references to stuff
> that looks like it is in std::basic_ios<blah blah>
> I have managed to convince waf to pass -lstdc++ but that has not
> helped and some people are claiming that I should link with g++ for
> that module.
> Does anyone have any ideas on how to convince waf to use g++ for that link?

Just for linking? Try something like this:

from TaskGen import after, feature
def protobuf_link_target(self):
     if == 'target name':
          self.link_task.env.CC = 'g++'

It is of course best if the c++ compiler is detected with a configuration test.


More information about the samba-technical mailing list