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.How


From: Daniel O'Connor
Subject: Re: [Discuss-gnuradio] Multiple C files required by single C++ block.How to build?
Date: Thu, 30 Nov 2006 10:43:39 +1030
User-agent: KMail/1.9.4

On Thursday 30 November 2006 06:35, Jonas Hodel wrote:
> Then:
> Within “howto_square2_ff.h” I added #include “test.h”.
> Within  “howto_square2_ff.cc” I added a call to jonas_test(), located in
> the constructor howto_square2_ff ().
> I added test.c to the “_howto_la_SOURCES” entry in “src/lib/Makefile.am”.
>
> 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

I think this means that the compiler has generated a reference to a C++ 
symbol - note the mangling in front.

I think you need to tell the compiler it's dealing with C when you declare the 
prototype for your C function.

I believe you do..
extern "C" {
#include "HeaderForMyCFunctions.h"
}

but my C++ fu is weak.

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Attachment: pgpCIB8PAeOIH.pgp
Description: PGP signature


reply via email to

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