discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Multiple C files required by single C++block.Ho


From: Jonas Hodel
Subject: Re: [Discuss-gnuradio] Multiple C files required by single C++block.Howto build?
Date: Thu, 30 Nov 2006 13:03:28 +1300
User-agent: Thunderbird 1.5.0.8 (X11/20061115)

Fantastic, works like a charm! I thought the problem was in the way I was using SWIG but the culprit was the C/C++ linkage. Now I can try it with my original files.

Thanks for all the help!

Jonas

Jan Schiefer wrote:

Finally: “make clean”, “make” and “make check”.

This results in:

ImportError: /home/jonas/gnuradio/gr-howto-write-a-block-3.0.2/src/lib/.libs/_howto.so: undefined symbol: _Z10jonas_testv

What you need to do is to surround the declaration of jonas_testv() with en extern "C" {} declaration. If you don't do this, then the linker is looking for the "mangled name" , which is C++'s way to embed type declarations in a function name. If the function is declared in the .h as extern "C", it will just expect the function name with an underscore in front of it, just like C does.

Cheers,
  Jan


=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================





reply via email to

[Prev in Thread] Current Thread [Next in Thread]