Linker problem with c++ application on next branch

Greetings,

Today I updated my gnuradio/next installation to the latest revision
and I now get a linker error trying to compile my application:

Linking CXX executable strx
/usr/bin/ld: CMakeFiles/strx.dir/strx/strx_source_c_impl.cpp.o:
undefined reference to symbol ‘_ZN3pmt6internERKSs’
/usr/bin/ld: note: ‘_ZN3pmt6internERKSs’ is defined in DSO
/opt/gnuradio/v3.6.4.1-1135-gc018b14e-next/lib/libgnuradio-pmt-3.7git.so.0.0.0
so try adding it to the linker command line
/opt/gnuradio/v3.6.4.1-1135-gc018b14e-next/lib/libgnuradio-pmt-3.7git.so.0.0.0:
could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [strx] Error 1
make[1]: *** [CMakeFiles/strx.dir/all] Error 2
make: *** [all] Error 2

As far as I can see libgnuradio-pmt is a new library and it does not
have it’s own package, so I assume a -lgnuradio-pmt is missing in the
pkg-config file of one of the other packages, perhaps
gnuradio-runtime.

The latest working gnuradio/next revision I have is
v3.6.4.1-1112-gd84b1dd4 but this does not have the libgnuradio-pmt
library.

Alex

On Mon, Apr 15, 2013 at 8:40 AM, Alexandru C. [email protected]
wrote:

As far as I can see libgnuradio-pmt is a new library and it does not
have it’s own package, so I assume a -lgnuradio-pmt is missing in the
pkg-config file of one of the other packages, perhaps
gnuradio-runtime.

Thanks, I’ll fix this right away.


Johnathan C.
Corgan Labs - SDR Training and Development Services
http://corganlabs.com

On Tue, Apr 16, 2013 at 4:22 PM, Alexandru C. [email protected]
wrote:

Hi Johnathan,

I saw you made the update, however, it seems this wasn’t enough as I
still get the same build error. This time I also noticed a problem
while building gnuradio so maybe the problem is somewhere else.

Just to conclude on this matter - gnuradio is fine now, it was a
problem in my own cmake macros.

Alex

On Mon, Apr 15, 2013 at 7:34 PM, Johnathan C.
[email protected] wrote:

On Mon, Apr 15, 2013 at 8:40 AM, Alexandru C. [email protected] wrote:

As far as I can see libgnuradio-pmt is a new library and it does not
have it’s own package, so I assume a -lgnuradio-pmt is missing in the
pkg-config file of one of the other packages, perhaps
gnuradio-runtime.

Thanks, I’ll fix this right away.

Hi Johnathan,

I saw you made the update, however, it seems this wasn’t enough as I
still get the same build error. This time I also noticed a problem
while building gnuradio so maybe the problem is somewhere else.

Here is what I do (xubuntu 12.10 64 with gcc 4.6 and 4.7 installed):

export CC=/usr/bin/gcc-4.6
export CXX=/usr/bin/g+±4.6
cmake -DCMAKE_INSTALL_PREFIX=/opt/gnuradio/v3.6.4.1-1146-gae625607-next
-DENABLE_GR_ATSC=OFF -DENABLE_GR_CTRLPORT=ON …

Then I type make and it builds fine, however, if I just type make
again (or make install for that matter) I get an error:
alc@PC1927:~/sdr/gnuradio/v3.6.4.1-1146-gae625607-next/build2$ make
[ 5%] Built target volk
[ 5%] Built target test_all
[ 5%] Built target volk_profile
[ 6%] Built target pygen_python_volk_modtool_dad04
[ 6%] Built target pygen_python_volk_modtool_f7e51
[ 6%] Built target doxygen_target
[ 6%] Built target pmt_generated
Linking CXX shared library libgnuradio-pmt-3.7git.so
make[2]: *** [gnuradio-runtime/lib/libgnuradio-pmt-3.7git.so.0.0.0]
Error 1
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/gnuradio-pmt.dir/all]
Error 2
make: *** [all] Error 2
alc@PC1927:~/sdr/gnuradio/v3.6.4.1-1146-gae625607-next/build2$

Subsequent attempts at “make” are OK, but my application still fails to
link.

My application (stlm/receiver at master · csete/stlm · GitHub) is
also built using cmake. I tried forcing it to gcc 4.6 instead of the
default 4.7. It will then give a symbol name in the error message:

/usr/bin/ld: CMakeFiles/strx.dir/strx/strx_source_c_impl.cpp.o:
undefined reference to symbol ‘pmt::intern(std::basic_string<char,
std::char_traits, std::allocator > const&)’
/usr/bin/ld: note: ‘pmt::intern(std::basic_string<char,
std::char_traits, std::allocator > const&)’ is defined in
DSO
/opt/gnuradio/v3.6.4.1-1146-gae625607-next/lib/libgnuradio-pmt-3.7git.so.0.0.0
so try adding it to the linker command line
/opt/gnuradio/v3.6.4.1-1146-gae625607-next/lib/libgnuradio-pmt-3.7git.so.0.0.0:
could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [strx] Error 1
make[1]: *** [CMakeFiles/strx.dir/all] Error 2
make: *** [all] Error 2
alc@PC1927:~/sdr/stlm.git/receiver/build$

Alex