1
我試圖編譯Boost.Python的一個項目,但遇到以下問題Boost.Python的未定義的符號問題
undefined symbol: _ZN5boost6python7objects23register_dynamic_id_auxENS0_9type_infoEPFNSt3__14pairIPvS2_EE
我使用cmake
...
# Find necessary packages
find_package(PythonLibs 2.7 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
find_package(Boost COMPONENTS python REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
add_library(test_py SHARED ${SOURCE_FILES})
list(APPEND CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
target_link_libraries(test_py lib1)
target_link_libraries(test_py boost_python)
target_link_libraries(test_py python2.7)
set_target_properties(test_py PROPERTIES PREFIX "")
構建它之後,我已經安裝腳本,將所有文件複製到目錄test_py,其中init .py文件
與
from test_py import *
任何想法我失蹤?
乾杯,邁克