|
From: | Jeon |
Subject: | Re: [Discuss-gnuradio] How to link an external libraries to solve ImportError: undefined symbol problem? |
Date: | Thu, 22 Dec 2016 01:30:49 +0900 |
Hi Jeon,
There's a "B" at the end of your "include_directories", but I guess that's just a copy&paste problem here – otherwise, compilation would've failed.
I think you need to use "${LIBBLUETOOTH_LIBRARIES}" in the target_link_libraries directive in your lib/CMakeLists.txt, not in link_directories in your main CMakeLists.txt.
Best regards,
Marcus
On 21.12.2016 16:48, Jeon wrote:
Jeon.I wonder that the above error is C++ level error or Python level error. And how can I fix it?$ python my_oot_module_swig.py$ /usr/local/lib/python2.7/dist-Debug log: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/greatscottAnd 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.gadgets/ubertooth/blob/master/ ) and I thought that I correctly linked the library.host/cmake/modules/ FindBLUETOOTH.cmake
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}
)
packages/my_oot_module
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
If infromation given in this post is not sufficient, please let me know it.
Regards,
_______________________________________________ Discuss-gnuradio mailing list address@hidden https://lists.gnu.org/mailman/ listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Prev in Thread] | Current Thread | [Next in Thread] |