Forum: GNU Radio Creating a USRP2 C++ Object

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mike Leferman (Guest)
on 2009-03-03 20:21
(Received via mailing list)
I'm working on a C++ program which directly creates an instance of a
USRP2
object.  When the program is being run, the following error is thrown:
/usr/local/lib/libusrp2.so.0: undefined
symbol: _ZN5gruel7sys_pri13usrp2_backendEv

Gruel was complied on the system and programs have been run using the
usrp2
in gnuradio.

What in the world does this error message mean, what could be throwing
it
and how can I fix it.  Thanks!
Eric B. (Guest)
on 2009-03-03 20:35
(Received via mailing list)
On Tue, Mar 03, 2009 at 01:19:15PM -0500, Mike Leferman wrote:
> I'm working on a C++ program which directly creates an instance of a USRP2
> object.  When the program is being run, the following error is thrown:
> /usr/local/lib/libusrp2.so.0: undefined
> symbol: _ZN5gruel7sys_pri13usrp2_backendEv
>
> Gruel was complied on the system and programs have been run using the usrp2
> in gnuradio.
>
> What in the world does this error message mean, what could be throwing it
> and how can I fix it.  Thanks!

Decoding the mangled name:

  $ c++filt _ZN5gruel7sys_pri13usrp2_backendEv
  gruel::sys_pri::usrp2_backend()

which OS/distribution/version?

Do you have /usr/local/lib in /etc/ld.so.conf?
Have you run $ sudo ldconfig?

Eric
Mike Leferman (Guest)
on 2009-03-05 19:48
(Received via mailing list)
I'm using Ubuntu 8.10, and /usr/local/lib is in my ld.so.conf.  Does
ldconfig just update ld.so.conf? My program finds libusrp2 in the
/usr/local/lib folder, so it should be able to find libgruel (which I'm
guessing is the problem?)  Do I have to have my program link libgruel as
well?  Is this failing because I don't use usrp2.lo when i link the
library?
 Thanks for the help!
- Mike
Eric B. (Guest)
on 2009-03-05 20:15
(Received via mailing list)
On Thu, Mar 05, 2009 at 12:47:24PM -0500, Mike Leferman wrote:
> I'm using Ubuntu 8.10, and /usr/local/lib is in my ld.so.conf.  Does
> ldconfig just update ld.so.conf? My program finds libusrp2 in the
> /usr/local/lib folder, so it should be able to find libgruel (which I'm
> guessing is the problem?)  Do I have to have my program link libgruel as
> well?  Is this failing because I don't use usrp2.lo when i link the library?
>  Thanks for the help!
> - Mike

Try using pkg-config to get the usrp2 dependencies:

  $ pkg-config usrp2 --cflags
  -DOMNITHREAD_POSIX=1 -pthread -I/usr/local/include
-I/usr/local/include/gnuradio

  $ pkg-config usrp2 --libs
  -L/usr/local/lib -lusrp2 -lgromnithread -lgruel

Eric
Mike Leferman (Guest)
on 2009-03-05 22:00
(Received via mailing list)
I ran those commands and those are the outputs I got.
Eric B. (Guest)
on 2009-03-05 22:03
(Received via mailing list)
On Thu, Mar 05, 2009 at 02:52:36PM -0500, Mike Leferman wrote:
> I ran those commands and those are the outputs I got.

It sounds like you're building your own code outside of our
framework.  Are you passing all of those flags to g++ when you're
compiling and linking?

Did you do a

  $ sudo ldconfig

sometime after installing libgruel?
Mike Leferman (Guest)
on 2009-03-05 22:09
(Received via mailing list)
Ah, but then I added the outputs to my makefile and now it works.
Thanks
for the help!

On Thu, Mar 5, 2009 at 2:52 PM, Mike Leferman
This topic is locked and can not be replied to.