I created a separate development tree outside of the main GNU Radio line
to keep my stuff nicely partitioned (at least for the moment).  From the
howto-build-a-block page and the SWIG docs, I was able to piece together
a Makefile (attached).  The problem is that when I go to create an
object file from the swig-produced C++ wrapper, I get errors.  I have
source files named:
rd_frame_filler.h
rd_frame_filler.i
rd_frame_filler.cc

I run the following commands.

$ swig -python -noruntime -c++ -I/usr/local/include/gnuradio \
-I/usr/local/include/gnuradio/swig -module rd rd_frame_filler.i

$ g++ -c -I/usr/local/include/gnuradio -I. -I/usr/include/python2.3 \
-I/usr/lib/python2.3/config -o rd_frame_filler.o rd_frame_filler.cc

$ g++ -I/usr/local/include/gnuradio -I. -I/usr/include/python2.3 \
-I/usr/lib/python2.3/config -shared rd_frame_filler_wrap.cxx \
rd_frame_filler.o -o rd_frame_filler.so

The final g++ command gives errors because it can't find any data
types/functions I defined.  It tries to find "frame_filler.h", which, of
course, doesn't exist.  I also tried (with same results)

$g++ -c -I/usr/local/include/gnuradio -I. -I/usr/include/python2.3 \
-I/usr/lib/python2.3/config rd_frame_filler_wrap.cxx

Does anyone know what I'm doing wrong? 


Thanks,
-Rahul
-- 
Rahul Dhar
[EMAIL PROTECTED]
Actually, my goal is to have a sandwich named after me.
include ../Makefile.common

SWIGCPPOPTIONS = -python -noruntime -c++    \
                 -I$(GRINCLUDEDIR)          \
                 -I$(SWIGINCLUDEDIR)

CPPOPTIONS = -I$(GRINCLUDEDIR)              \
             -I.                            \
             -I/usr/include/python2.3       \
             -I/usr/lib/python2.3/config

all: swig cpp link

swig:
        swig $(SWIGCPPOPTIONS) -module rd rd_frame_filler.i

cpp: swig
        g++ -c $(CPPOPTIONS) -o rd_frame_filler.o rd_frame_filler.cc
        g++ -c $(CPPOPTIONS) rd_frame_filler_wrap.cxx

link: swig cpp
        ld -shared rd_frame_filler.o rd_frame_filler_wrap.cxx -o 
rd_frame_filler.so

clean:
        rm -f rd.py rd_frame_filler_wrap.cxx rd_frame_filler.o
# gnu radio include
GRINCLUDEDIR     = /usr/local/include/gnuradio

# swig includes
SWIGINCLUDEDIR   = $(GRINCLUDEDIR)/swig

Attachment: pgpVa7i4LkzjG.pgp
Description: PGP signature

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

Reply via email to