# Link error in compilation of sample programs in /uhd/host/examples

**URL:** <https://www.ruby-forum.com/t/link-error-in-compilation-of-sample-programs-in-uhd-host-examples/228610>\
**Category:** GNU Radio\
**Created:** [April 30, 2013, 5:07am UTC](https://www.ruby-forum.com/t/link-error-in-compilation-of-sample-programs-in-uhd-host-examples/228610 "2013-04-30T05:07:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 30, 2013, 5:07am UTC](https://www.ruby-forum.com/t/link-error-in-compilation-of-sample-programs-in-uhd-host-examples/228610/1 "2013-04-30T05:07:44Z")

</div>

Hi all,

I installed GnuRadio+UHD onto Ubuntu 12.10(64bit) and 13.04(64bit) by  
using  
build-gnuradio script in [http://www.sbrac.org/files/build-gnuradio](http://www.sbrac.org/files/build-gnuradio). No  
error  
message had been displayed in the installation. But a following link  
error  
message is shown when I compile sample c++ programs in  
/uhd/host/examples.

\*\*\*\*\*\*\*\* error message \*\*\*\*\*\*\*\*\*\*\*

> Scanning dependencies of target benchmark\_rate  
> [5%] Building CXX object CMakeFiles/benchmark\_rate.dir/benchmark\_rate.cpp.o  
> Linking CXX executable benchmark\_rate  
> /usr/bin/ld: CMakeFiles/benchmark\_rate.dir/benchmark\_rate.cpp.o: undefined  
> reference to symbol \>‘\_ZTVN5boost6detail16thread\_data\_baseE’  
> /usr/bin/ld: note: ‘\_ZTVN5boost6detail16thread\_data\_baseE’ is defined in  
> DSO /usr/lib/libboost\_thread.so.1.49.0 \>so try adding it to the linker  
> command  
> line  
> /usr/lib/libboost\_thread.so.1.49.0: could not read symbols: Invalid operation  
> collect2: error: ld returned 1 exit status  
> make[2]: \*\*\* [benchmark\_rate] Error 1  
> make[1]: \*\*\* [CMakeFiles/benchmark\_rate.dir/all] Error 2  
> make: \*\*\* [all] Error 2

* * *

The compile procedure I use is following:  
$ mkdir /uhd/host/examples/build  
$ cd /uhd/host/examples/build  
$ cmake …/  
$ make

“ldconfig -p | grep boost\_thread” returns

libboost\_thread.so.1.49.0 (libc6,x86-64) =\>  
/usr/lib/libboost\_thread.so.1.49.0  
libboost\_thread.so (libc6,x86-64) =\> /usr/lib/libboost\_thread.so

therefore, I think that the path to boost library is recognized by  
operating  
system.

I would like you to inform me my mistake.

Regards,  
Nakajo

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 30, 2013, 5:47am UTC](https://www.ruby-forum.com/t/link-error-in-compilation-of-sample-programs-in-uhd-host-examples/228610/2 "2013-04-30T05:47:27Z")

</div>

> therefore, I think that the path to boost library is recognized by operating  
> system.
> 
> I would like you to inform me my mistake.

So in this case, it looks like you configured the cmake project with the  
root directory of /uhd/host/examples. However it cant be used this way.  
A lot of important variables get set in the top level CMakelists.txt

For what its worth, the examples always get built with the install. You  
can find them in install\_prefix/lib/uhd/examples

-josh
