GNU Radio and usrp_standard.h: No such file or directory

hello,
I am trying to compile this C++ file:
http://gnuradio.org/redmine/wiki/1/UsrpFAQCppInterface
by doing:
g++ usrp_test_c++.cpp -o testusrp -lusrp

and I get the following error:
test_usrp_standard_rx.cc:28:39: error: usrp_standard.h: No such file
or directory

I am on a ubuntu 10.4 (32bit) system with gnuradio 3.3.0 properly (I
guess) installer (from git) in /media/lin_sw/gnuradio/current
from env I see that:

LD_LIBRARY_PATH=/usr/lib/:/media/lin_sw/gnuradio/current/lib

I do not seem to figure out what I am missing, can anybody please help.

thanks a lot
fabrizio
PS “current” is actually a symbolic link to the folder 3.3.0 in the
same location as suggested in here:
http://wiki.frednet.org/index.php/GNU_Radio_Installation_Guide

On Fri, Sep 17, 2010 at 05:02:00PM +0200, Fabrizio T. wrote:

I am on a ubuntu 10.4 (32bit) system with gnuradio 3.3.0 properly (I
same location as suggested in here:
http://wiki.frednet.org/index.php/GNU_Radio_Installation_Guide

Assuming you’ve done a “make install”, pkg-config will tell you the
cflags and libs you need to use. You’ll need to have your
PKG_CONFIG_PATH set correctly for this to work. If you installed into
the default prefix (/usr/local), the you’ll need either:

$ export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

or

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Depending on whether you’re on a 64-bit machine and/or what OS and
distribution you’re using

On my x86_64 machine running Fedora 13:

$ echo $PKG_CONFIG_PATH
/usr/local/lib64/pkgconfig

$ pkg-config --cflags usrp
-I/usr/local/include
$ pkg-config --libs usrp
-L/usr/local/lib64 -lusrp -lusb

Eric

Dear Eric,
thank you for your help.
Yes I have done “make install” and defined the various path using a
“source .gnuradiorc” inside by .bashrc and in fact:

~$ more .gnuradiorc
export PATH=$PATH:/media/lin_sw/gnuradio/current/bin
export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/media/lin_sw/gnuradio/current/lib
export
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/media/lin_sw/gnuradio/current/lib/pkgconfig
export
PYTHONPATH=$PYTHONPATH:/media/lin_sw/gnuradio/current/lib/python2.6/site-packages

if I check the PKG_CONFIG_PATH as you suggest, this is what I get:

~$ echo $PKG_CONFIG_PATH
:/media/lin_sw/gnuradio/current/lib/pkgconfig
~$ pkg-config --cflags usrp
-I/media/lin_sw/gnuradio/3.3.0/include
~$ pkg-config --libs usrp
-L/media/lin_sw/gnuradio/3.3.0/lib -lusrp -lusb

Everything seems correct to me but probably something is not. If you
have any more ideas please let me know.
Best Regards,
Fabrizio
PS just to clarify, I am on a 32bit linux ubuntu machine with gnuradio
installed in /media/lin_sw/gnuradio/3.3.0 and with a symbolic link
/media/lin_sw/gnuradio/current point at the 3.3.0 folder.

Dear All,
I’d like to add a little piece of information about this problem.
if I try to compile the previously mentioned code with:
g++ usrp_test_c++.cpp -o testusrp pkg-config --cflags usrp
pkg-config --libs usrp

and I change:
#include “usrp_standard.h”
in:
#include “usrp/usrp_standard.h”
#include <stdio.h>

the code from here:
http://gnuradio.org/redmine/wiki/1/UsrpFAQCppInterface

almost compile…
The solution to this problem does however implies lots of
modifications for the gcc line. Perhaps somebody who knows how the
“pkg-config” works could comment on it.
Also the source file that I am using is right in the gnuradio.org
site, put there as first example for people who begin using the gnu
radio package in C++. How come the stdio.h is not declared? also line:
urx->read(&bufr0, bufsize, &overrun);
seems to be wrong… Perhaps a better C++ example should be put there?

Just my very humble opinion/suggestion.

Best regards
Fabrizio

On Mon, Sep 20, 2010 at 9:27 AM, Fabrizio T.

On Tue, Sep 21, 2010 at 2:26 PM, Thomas T. [email protected] wrote:

in:
dated. It should now compile with gnuradio 3.3 and recent Linux
distributions.

Thomas

Fabrizio,

I made some edits to the FAQ page you pointed to
(http://gnuradio.org/redmine/wiki/1/UsrpFAQCppInterface). I added more
information about how to set up and use pkg-config for linking to
libusrp when GNU Radio isn’t installed in the standard paths.

Hope this helps…

Tom

Tom,
that is exactly the conclusion I came to after lots of googleing !.
Thanks a lot for the really good help. I am glad that now guys who
adventure in c++ development will have this piece of info.

Regards,
Fabrizio

On Tue, Sep 21, 2010 at 10:20 AM, Fabrizio T.
[email protected] wrote:

#include <stdio.h>

the code from here:
http://gnuradio.org/redmine/wiki/1/UsrpFAQCppInterface

almost compile…

As you discovered, there are a number of problems with the example
code. I made some quick changes to the wiki page, which was quite
dated. It should now compile with gnuradio 3.3 and recent Linux
distributions.

Thomas