discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking .so library leads to AttributeError: 'module' object has no


From: Ron Economos
Subject: Re: Linking .so library leads to AttributeError: 'module' object has no attribute 'blockname'
Date: Fri, 22 Nov 2019 02:28:57 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

The Reed-Solomon encoder/decoder is already part of GNU Radio. You don't have to link an external module. Just include the FEC component. In the top level CMakeLists.txt:

set(GR_REQUIRED_COMPONENTS RUNTIME FEC)

Ron

On 11/22/19 02:18, Massimo Isonni wrote:
Hi,

I've been trying for 3 full days now to link a shared object library to my OOT module.
I am trying to link the libfec.so library in order to use the reed-solomon encoding and decoding functions.

As found on the internet i have made a FindFec.cmake file inside cmake/Modules as follows shown below.
I edited my CMakeLists.text in main directory adding find_package(Fec)
I added include dir to include_directories and Library to target_link_library in lib/CMakeLists.text
As shown below.
However whenever i cmake .. make sudo make install and sudo ldconfig if i run make tests or if i try to run python test from python IF a function from the library is used, and only in that case, an attribute not found error will show.
If i edit cpp test testing the class that is using the library function during compile time it will show that said function is not defined. i.e.:

CMakeFiles/test-AX100.dir/Encoder.cpp.o: nella funzione "Encoder::Encode(unsigned char*, int, char const*)":
Encoder.cpp:(.text+0x61): riferimento non definito a "encode_rs_8(unsigned char*, unsigned char*, int)"
collect2: error: ld returned 1 exit status
lib/CMakeFiles/test-AX100.dir/build.make:155: set di istruzioni per l'obiettivo "lib/test-AX100" non riuscito
make[2]: *** [lib/test-AX100] Errore 1
CMakeFiles/Makefile2:159: set di istruzioni per l'obiettivo "lib/CMakeFiles/test-AX100.dir/all" non riuscito
make[1]: *** [lib/CMakeFiles/test-AX100.dir/all] Errore 2
Makefile:140: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

sadly it is in italian, however it says that reference to encode_rs_8() not defined.

While through python tests:

E
======================================================================
ERROR: test_001_t (__main__.qa_Msg_Encoder)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "qa_Msg_Encoder.py", line 35, in test_001_t
    enc = AX100.Msg_Encoder("in1","out1")
AttributeError: 'module' object has no attribute 'Msg_Encoder'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

Thanks for your support!
Massimo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]