I followed the gnuradio wiki page commands to create a new block.

smookin@comsec-ThinkCentre-M90p:~/Desktop$ gr_modtool.py create howto
Module directory is "./gr-howto".
Creating directory...
Copying howto example...
Unpacking...
Replacing occurences of 'howto' to 'howto'...
Skipping ./apps
Skipping ./docs/doxygen/doxyxml
Skipping ./docs/doxygen/doxyxml/example
Skipping ./docs/doxygen/doxyxml/example/xml
Skipping ./docs/doxygen/doxyxml/generated
Skipping ./cmake
Skipping ./cmake/Modules
Skipping ./grc
Done.
Use 'gr_modtool add' to add a new block to this currently empty module.
smookin@comsec-ThinkCentre-M90p:~/Desktop$ cd gr-howto/
smookin@comsec-ThinkCentre-M90p:~/Desktop/gr-howto$ gr_modtool.py add -t
sync square_ff
Operating in directory .
GNU Radio module name identified: howto
Code is of type: sync
Block/code identifier: square_ff
Full block/code identifier is: howto_square_ff
Enter valid argument list, including default arguments:
Add Python QA code? [Y/n]
Add C++ QA code? [Y/n]
Traversing lib...
Adding file 'howto_square_ff.h'...
Adding file 'howto_square_ff.cc'...
Adding file 'qa_howto_square_ff.cc'...
Traversing swig...
Editing swig/howto_swig.i...
Traversing python...
Adding file 'qa_howto_square_ff.py'...
Editing python/CMakeLists.txt...
Traversing grc...
Adding file 'howto_square_ff.xml'...
Editing grc/CMakeLists.txt...

I have attached the header file that is generated through gr_modtool. You
can notice that the generated API is not included in the header file.
I added the API manually and called the sptr using API header to solve this
problem.

Regards,
--Khizer Kaleem
Graduate Research Student
Department of Electrical and Computer Engineering
University of Waterloo, Canada


On Fri, Feb 1, 2013 at 4:27 AM, Martin Braun (CEL) <[email protected]>wrote:

> On Thu, Jan 31, 2013 at 07:37:30PM -0500, Khizer Kaleem wrote:
> > Thanks Josh. It worked. Apparently, the gr_modtool.py is not including
> the API
> > in the header.
>
> Well, it should.
> I must admit I bungled gr_modtool a bit while working on porting it to
> 3.6.4, but it should be in a working state now.
>
> Can you please post the command you used to add the block and the header
> that was generated?
>
> MB
>
>
> >
> >
> > -Khizer Kaleem
> >
> >
> >
> > On Thu, Jan 31, 2013 at 4:32 PM, Josh Blum <[email protected]> wrote:
> >
> >
> >
> >     > 2: Test command: /bin/sh
> >     > "/home/mkk/Desktop/gr-howto/build/python/qa_square_ff_test.sh"
> >     > 2: Test timeout computed to be: 9.99988e+06
> >     > 2: Traceback (most recent call last):
> >     > 2:   File
> "/home/mkk/Desktop/gr-howto/python/qa_howto_square_ff.py", line
> >     > 23, in <module>
> >     > 2:     import howto_swig as howto
> >     > 2:   File "/home/mkk/Desktop/gr-howto/build/swig/howto_swig.py",
> line 24,
> >     > in <module>
> >     > 2:     _howto_swig = swig_import_helper()
> >     > 2:   File "/home/mkk/Desktop/gr-howto/build/swig/howto_swig.py",
> line 20,
> >     > in swig_import_helper
> >     > 2:     _mod = imp.load_module('_howto_swig', fp, pathname,
> description)
> >
> >     > 2: *ImportError:
> /home/mkk/Desktop/gr-howto/build/swig/_howto_swig.so:
> >     > undefined symbol: _Z20howto_make_square_ffv*
> >
> >     > 2/2 Test #2: qa_square_ff .....................***Failed    0.09
> sec
> >     >
> >     > 50% tests passed, 1 tests failed out of 2
> >     >
> >     > Total Test time (real) =   0.11 sec
> >     >
> >     > The following tests FAILED:
> >     >   2 - qa_square_ff (Failed)
> >     > Errors while running CTest
> >     >
> >
> >     > I know this a linking problem error.If anyone can *help* with this
> I
> >     *would*
> >     >  really *appreciate. *
> >     > *
> >     > *
> >     Well, it says the symbol is missing: undefined symbol:
> >     _Z20howto_make_square_ffv*
> >
> >     So this is something declared in a header file but not exposed by
> your
> >     library. You probably need to implement howto_make_square_ffv, or
> make
> >     sure the declaration in the header file has the proper API export
> macro.
> >
> >     -josh
> >
> >     _______________________________________________
> >     Discuss-gnuradio mailing list
> >     [email protected]
> >     https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> >
> >
>
> > _______________________________________________
> > Discuss-gnuradio mailing list
> > [email protected]
> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
> --
> Karlsruhe Institute of Technology (KIT)
> Communications Engineering Lab (CEL)
>
> Dipl.-Ing. Martin Braun
> Research Associate
>
> Kaiserstraße 12
> Building 05.01
> 76131 Karlsruhe
>
> Phone: +49 721 608-43790
> Fax: +49 721 608-46071
> www.cel.kit.edu
>
> KIT -- University of the State of Baden-Württemberg and
> National Laboratory of the Helmholtz Association
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
/* -*- c++ -*- */
/* 
 * Copyright 2013 <+YOU OR YOUR COMPANY+>.
 * 
 * This 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.
 * 
 * This software 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 this software; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street,
 * Boston, MA 02110-1301, USA.
 */

#ifndef INCLUDED_HOWTO_SQUARE_FF_H
#define INCLUDED_HOWTO_SQUARE_FF_H

#include <gr_sync_block.h>

class howto_square_ff;
typedef boost::shared_ptr<howto_square_ff> howto_square_ff_sptr;

howto_square_ff_sptr howto_make_square_ff ();

/*!
 * \brief <+description+>
 *
 */
class howto_square_ff : public gr_sync_block
{
	friend howto_square_ff_sptr howto_make_square_ff ();

	howto_square_ff ();

 public:
	~howto_square_ff ();


	int work (int noutput_items,
		gr_vector_const_void_star &input_items,
		gr_vector_void_star &output_items);
};

#endif /* INCLUDED_HOWTO_SQUARE_FF_H */

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to