Saturday, March 3, 2018

Re: [Discuss-gnuradio] compile gnuradio in cmake

Hi Ruiy,

I am also new to GNU Radio. If I am right, I think you are trying to build a flow graph using C++. Is there a specific reason you are not using GRC and Python?

Regards,
Sakthivel

On Sat, Mar 3, 2018 at 6:02 AM, ruiy <2997215859@qq.com> wrote:
I am trying to compile gnuradio by cmake. I have writen the CMakeLists to compile my program.
It can work when I don't use qtgui. But a error occur when I use qtgui.  The error is exit code 139 which showed in  the picture following. I cannot understand what happen.

CMakeLists.txt:
cmake_minimum_required(VERSION 3.9)
project(TestQtGui)

set(CMAKE_PREFIX_PATH /home/calt/Qt5.9.4/5.9.4/gcc_64)
find_package(Qt5Widgets)
find_package(Qt5Core)
find_package(Qt5Gui)

find_package(Boost "1.35" COMPONENTS filesystem system)

set(GR_REQUIRED_COMPONENTS QTGUI)
find_package(Gnuradio "3.7.2" REQUIRED)

include_directories(
${GNURADIO_ALL_INCLUDE_DIRS}
)

set(SOURCE_FILES main.cpp)
add_executable(TestQtGui ${SOURCE_FILES})
target_link_libraries(TestQtGui Qt5::Widgets
Qt5::Gui
${Boost_LIBRARIES}
${GNURADIO_ALL_LIBRARIES})

main.cpp:
#include <gnuradio/top_block.h>
#include <gnuradio/qtgui/time_sink_f.h>

int main() {
int rate = 48000;
gr::top_block_sptr tb = gr::make_top_block("testQtGui");
gr::qtgui::time_sink_f::sptr t_bk = gr::qtgui::time_sink_f::make(1024, rate, "", 1);
}

errors:
home/calt/workspace/TestQtGui/cmake-build-debug/TestQtGui
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Pictures:


I can't understand what cause the exit code 139. Any wrong with my cmakelists.txt?

I will appreciate it If you can solve. Thank you very much.


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


No comments:

Post a Comment