Undefined symbol error

Hi all,

today I got really strange problem. Everything was in perfect order, I
was
designing a new block, and when finished I tried to test it, but the
following error came:

ImportError:
/home/savi_ne/work/gnuradio/gr-test/build/swig/_test_swig.so:

undefined symbol: _ZN20test_synchro14enter_have_sofEv

And what is the most important the error comes for the block called
synchro
which i designed few days ago and even this morning it was passing test.
I use RHEL6. Tried with deleting everything and building again, also the
same block with the different name. There are two or three posts on this
problem, quite old and without solution.

Thank you

On Thu, Jun 20, 2013 at 8:34 AM, Nemanja S. [email protected]
wrote:

And what is the most important the error comes for the block called synchro
which i designed few days ago and even this morning it was passing test.
I use RHEL6. Tried with deleting everything and building again, also the
same block with the different name. There are two or three posts on this
problem, quite old and without solution.

Thank you


Nemanja Savić

Are you using the 3.7 API style or 3.6?

These errors usually occur because of a missing piece in your SWIG .i
file. Or you might have accidentally removed something from your
public header file. Just walk through the files of this block again to
make sure that the ‘enter_have_sof’ is properly defined everywhere.
I’m sure it’s something simple that’s missing.

Tom

Hi,

I am using 3.6 style.
And the problem is due to inline functions. Why? In some other blocks I
have inline functions?

i am pretty sure when I delete inline it passes, otherwise not.
Prototypes
are the same for sure. The prototypes in .i file are the same even for
inline and non-inline functions, i also checked that.

On Thu, Jun 20, 2013 at 9:38 AM, Nemanja S. [email protected]
wrote:

Hi,

I am using 3.6 style.
And the problem is due to inline functions. Why? In some other blocks I have
inline functions?

No, there are no problems with inline functions. Are you sure the
function prototype in your header file and in the .i file are exactly
the same?

Tom

It does make sense. I am pretty sure that I have taken those functions
from
one of the blocks provided with gnuradio.
I can’t find it at the moment but i will check.

Thank you

On Thu, Jun 20, 2013 at 9:53 AM, Nemanja S. [email protected]
wrote:

i am pretty sure when I delete inline it passes, otherwise not. Prototypes
are the same for sure. The prototypes in .i file are the same even for
inline and non-inline functions, i also checked that.

Actually, thinking about it, no, you can’t use inline here. And
there’s no place in our code where we inline functions that are
exported as a block’s function through swig. It doesn’t really make
sense to export an inlined function through a library. Wouldn’t do any
good for the other side calling it. If they aren’t changing any state
of your object, you can declare them const and then trust the compiler
to help you out here.

You can use inline functions in your implementation, or something
that’s private/protected and not exported as part of the library. Not
every functions needs to or should be exported.

Tom