My files are attached. Everyone is correctly referenced in the Makefiles.
2012/3/1 Tom Rondeau <[email protected]> > On Thu, Mar 1, 2012 at 11:20 AM, André Selva <[email protected]>wrote: > >> I'm using autotools. And I checked many times, and all the Makefiles are >> updated correctly with the new block's information. >> >> One strange point is that even if I delete all the references from the >> block from all the Makefiles, the problem still persist. >> >> Att, > > > Well, then I'm not too sure what else to tell you. There's obviously > something wrong with how you've set up the block; that's really the only > explanation. Are you absolutely sure you did everything correctly? What > about the main .i file that includes "#include <yourheader.h>" and > "%include "yourswig.i" files? > > Tom > > > >> 2012/2/29 Tom Rondeau <[email protected]> >> >>> On Wed, Feb 29, 2012 at 5:26 PM, André Selva <[email protected]>wrote: >>> >>>> Hi! >>>> >>>> I develop a new block to my own library (called >>>> gr_my_divisorcamadas_ff) . The compilation runs successfully, but when I >>>> execute a flow graph with any block from the library, I got the following >>>> message: >>>> >>>> Traceback (most recent call last): >>>> File "/home/rt-dsp/Desktop/Howtowrite/gr-my-basic/top_block.py", line >>>> 14, in <module> >>>> import gr_my >>>> File "/usr/local/lib/python2.7/dist-packages/gr_my/__init__.py", line >>>> 40, in <module> >>>> from gr_my_swig import * >>>> File "/usr/local/lib/python2.7/dist-packages/gr_my/gr_my_swig.py", >>>> line 24, in <module> >>>> _gr_my_swig = swig_import_helper() >>>> File "/usr/local/lib/python2.7/dist-packages/gr_my/gr_my_swig.py", >>>> line 20, in swig_import_helper >>>> _mod = imp.load_module('_gr_my_swig', fp, pathname, description) >>>> ImportError: /usr/local/lib/libgnuradio-gr_my-3.3.0.so.0: undefined >>>> symbol: _ZTV23gr_my_divisorcamadas_ff >>>> >>>> >>>> >>>> Even if I delete the reference from the new block in all make files and >>>> re-compile the library, the error still persist. >>>> >>>> Any ideas? >>>> >>>> >>>> Best Regards, >>>> -- >>>> André F. B. Selva - >>>> >>> >>> We're going to need more information. Are you using cmake or autotools >>> (Makefile.am) to do this? Are you sure you're editing the .cc, .h, and .i >>> files, AND are you making sure that the relevant files in your build system >>> are updated with the correct information? >>> >>> The error just sounds like you haven't gotten all of the files updated >>> correctly. >>> >>> Tom >>> >>> >> >> >> -- >> André F. B. Selva - >> SECOMP - Semana da Computação da Unicamp 2012 >> Coordenador Geral >> CACo - Centro Acadêmico da Computação >> >> > -- André F. B. Selva - SECOMP - Semana da Computação da Unicamp 2012 Coordenador Geral CACo - Centro Acadêmico da Computação
/* -*- c++ -*- */
/*
* Copyright 2004 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
/*
* config.h is generated by configure. It contains the results
* of probing for features, options etc. It should be the first
* file included in your .cc file.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gr_my_divisorcamadas_ff.h>
#include <gr_io_signature.h>
#include <stdio.h>
/*
* Create a new instance of gr_my_divisorcamadas_ff and return
* a boost shared_ptr. This is effectively the public constructor.
*/
gr_my_divisorcamadas_ff_sptr
gr_make_my_divisorcamadas_ff ()
//gr_make_my_divisorcamadas_ff ()
{
return gr_my_divisorcamadas_ff_sptr (new gr_my_divisorcamadas_ff ());
//return gr_my_divisorcamadas_ff_sptr (new gr_my_divisorcamadas_ff ());
}
/*
* Specify constraints on number of input and output streams.
* This info is used to construct the input and output signatures
* (2nd & 3rd args to gr_block's constructor). The input and
* output signatures are used by the runtime system to
* check that a valid number and type of inputs and outputs
* are connected to this block. In this case, we accept
* only 1 input and 1 output.
*/
static const int MIN_IN = 1; // mininum number of input streams
static const int MAX_IN = 1; // maximum number of input streams
static const int MIN_OUT = 4; // minimum number of output streams
static const int MAX_OUT = 4; // maximum number of output streams
/*
* The public constructor
*/
gr_my_divisorcamadas_ff::gr_my_divisorcamadas_ff ()
//gr_my_divisorcamadas_ff::gr_my_divisorcamadas_ff ()
: gr_block ("my_divisorcamadas_ff",
gr_make_io_signature (MIN_IN, MAX_IN, sizeof (float)),
gr_make_io_signature (MIN_OUT, MAX_OUT, sizeof (float)))
{
}
/*
* Our destructor.
*/
void gr_my_divisorcamadas_ff::forecast ( int noutput_items,gr_vector_int &ninput_items_required)
{
ninput_items_required[0]=204;
}
int
gr_my_divisorcamadas_ff:: general_work(int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const int *in = (const int *) input_items[0];
const int ninput = (const int) ninput_items[0];
int *outA = (int *) output_items[0];
int *outB = (int *) output_items[1];
int *outC = (int *) output_items[2];
int *outIIP = (int *) output_items[3];
int info;
info = in[190] & 240; //extrair os 4 bits mais significativos
info = info >> 4; // deslocamento
switch (info){
case 1: //camada A
for (int i =0; i<ninput; i++) outA[i] = in[i];
break;
case 2: //camada B
for (int i =0; i<ninput; i++) outB[i] = in[i];
break;
case 3: //camada C
for (int i =0; i<ninput; i++) outC[i] = in[i];
break;
case 8: //IIP
for (int i =0; i<ninput; i++) outIIP[i] = in[i];
break;
}
//consumo os itens da entrada
this->consume(0,ninput);
// Tell runtime system how many output items we produced.
return noutput_items;
}
/* -*- c++ -*- */ /* * Copyright 2004 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_GR_MY_divisorcamadas_FF_H #define INCLUDED_GR_MY_divisorcamadas_FF_H #include <gr_block.h> class gr_my_divisorcamadas_ff; /* * We use boost::shared_ptr's instead of raw pointers for all access * to gr_blocks (and many other data structures). The shared_ptr gets * us transparent reference counting, which greatly simplifies storage * management issues. This is especially helpful in our hybrid * C++ / Python system. * * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm * * As a convention, the _sptr suffix indicates a boost::shared_ptr */ typedef boost::shared_ptr<gr_my_divisorcamadas_ff> gr_my_divisorcamadas_ff_sptr; /*! * \brief Return a shared_ptr to a new instance of gr_my_divisorcamadas_ff. * * To avoid accidental use of raw pointers, gr_my_divisorcamadas_ff's * constructor is private. gr_my_divisorcamadas_ff is the public * interface for creating new instances. */ gr_my_divisorcamadas_ff_sptr gr_make_my_divisorcamadas_ff (); //gr_my_divisorcamadas_ff_sptr gr_make_my_divisorcamadas_ff (); /*! * \brief amplify a stream of floats. * \ingroup block * * This uses the preferred technique: subclassing gr_sync_block. */ class gr_my_divisorcamadas_ff : public gr_block { private: // The friend declaration allows gr_my_divisorcamadas_ff to // access the private constructor. friend gr_my_divisorcamadas_ff_sptr gr_make_my_divisorcamadas_ff (); //friend gr_my_divisorcamadas_ff_sptr gr_make_my_divisorcamadas_ff (); // gr_my_divisorcamadas_ff (); // private constructor //gr_my_divisorcamadas_ff (); // private constructor public: gr_my_divisorcamadas_ff (); // public constructor ~gr_my_divisorcamadas_ff (); // public destructor void forecast ( int noutput_items,gr_vector_int &ninput_items_required); // Where all the action really happens int general_work( int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_MY_divisorcamadas_FF_H */
gr_my.i
Description: Binary data
gr_my_divisorcamadas_ff.i
Description: Binary data
_______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
