discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] How to link an external libraries to solve ImportErro


From: Jeon
Subject: [Discuss-gnuradio] How to link an external libraries to solve ImportError: undefined symbol problem?
Date: Thu, 22 Dec 2016 00:48:08 +0900

In my OOT module, I am using `libbluetooth-dev` library by BlueZ. I am using a couple of APIs of it such as `hci_read_clock`. I am using FindBluetooth cmake module (https://github.com/greatscottgadgets/ubertooth/blob/master/host/cmake/modules/FindBLUETOOTH.cmake) and I thought that I correctly linked the library.

find_package(Bluetooth REQUIRED)
if(NOT LIBBLUETOOTH_FOUND)
    message(FATAL_ERROR "bluez (libbluetooth-dev) required")
endif()

include_directories(
    ${CMAKE_SOURCE_DIR}/lib
    ${CMAKE_SOURCE_DIR}/include
    ${CMAKE_BINARY_DIR}/lib
    ${CMAKE_BINARY_DIR}/include
    ${Boost_INCLUDE_DIRS}
    ${CPPUNIT_INCLUDE_DIRS}
    ${GNURADIO_ALL_INCLUDE_DIRS}
    ${LIBBLUETOOTH_INCLUDE_DIR}B
)

link_directories(
    ${Boost_LIBRARY_DIRS}
    ${CPPUNIT_LIBRARY_DIRS}
    ${GNURADIO_RUNTIME_LIBRARY_DIRS}
    ${LIBBLUETOOTH_LIBRARIES}
)

And I successfully built and installed my OOT module. To test it, I made a simple flow graph but it fails to run. After some debugging, It seems that I reached at the dead end.

Debug log:

$ /usr/local/lib/python2.7/dist-packages/my_oot_module
$ python my_oot_module_swig.py
Traceback (most recent call last):
  File "my_oot_module_swig.py", line 28, in <module>
    _my_oot_module_swig = swig_import_helper()
  File "my_oot_module_swig.py", line 24, in swig_import_helper
    _mod = imp.load_module('_my_oot_module_swig', fp, pathname, description)
ImportError: /usr/local/lib/libgnuradio-my_oot_module.so: undefined symbol: hci_read_clock

I wonder that the above error is C++ level error or Python level error. And how can I fix it?

If infromation given in this post is not sufficient, please let me know it.

Regards,
Jeon.

reply via email to

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