我用C++在GNU Radio中开发了一个树外块。我使用的是ZMQ套接字,它是用<zmq.hpp>库,通过两个线程传递数据。
当我尝试在GNU Radio配套程序中执行OOT块(pthread块(时,它显示的是:AttributeError:"module"对象没有属性"pthread"。
Traceback (most recent call last): File "/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py", line 161, in <module> main() File "/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py", line 149, in main tb = top_block_cls() File "/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py", line 116, in __init__ self.pthread_pthread_0 = pthread.pthread() AttributeError: 'module' object has no attribute 'pthread'
这些天我一直在努力解决这个错误。。。我在顶部的CMakeLists.txt中添加了单词ZEROQM:set(GR_REQUIRED_COMPONENTS RUNTIME ZEROMQ(,但它仍然不起作用。
我在github中有我的块的OOT代码:https://github.com/isaactd92/gr-pthread.git.
我真的很感谢在这个问题上的任何帮助。当做艾萨克。
我解决了这个问题。。。。线索在CMakeLists.txt中:
- 下载并安装数据包:https://github.com/zeromq/cppzmq.这将带来zmq.hpp库和ZeroMQconfig.cmake
- 配置位于
(${SOURCE_DIRECTORY})
中的CMakeLists.txt。在# Find gnuradio build dependencies
中添加find_package(ZeroMQ)
- 配置位于/lib中的CMakeLists.txt。在
target_link_libraries
中包括zmq
正常构建OOT块,它将识别zmq套接字并消除问题:(