mars Mac 系统-编译失败,求大佬解答

9avjhtql  于 2022-11-19  发布在  Mac
关注(0)|答案(1)|浏览(243)

[100%] Linking CXX shared library libmarsstn.so
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/log/../boost/iostreams/device/mapped_file.hpp:295: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::is_open() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/log/../boost/iostreams/device/mapped_file.hpp:299: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::flags() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/log/../boost/iostreams/device/mapped_file.hpp:466: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::data() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/log/../boost/iostreams/device/mapped_file.hpp:295: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::is_open() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/log/../boost/iostreams/device/mapped_file.hpp:298: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::operator!() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/log/../boost/iostreams/device/mapped_file.hpp:243: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::mapped_file_source()'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:298: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::operator!() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:295: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::is_open() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:295: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::is_open() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:298: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::operator!() const'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:296: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::close()'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:296: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::close()'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:296: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::close()'
/Users/xiekongying/Desktop/xky/ke/im/mars/mars/comm/../boost/iostreams/device/mapped_file.hpp:439: error: undefined reference to 'mars_boost::iostreams::mapped_file_source::open_impl(mars_boost::iostreams::basic_mapped_file_params<mars_boost::iostreams::detail::path> const&)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libmarsstn.so] Error 1
make[1]: *** [CMakeFiles/marsstn.dir/all] Error 2
make: *** [all] Error 2
!!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!

ujv3wf0j

ujv3wf0j1#

mars/log CMakeLists.txt中修改:
if(MSVC)
add_definitions(/FI"../../comm/projdef.h")

include_directories(../comm/windows)
include_directories(../comm/windows/zlib)

elseif(ANDROID)
file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR}
../comm/xlogger/xloggerbase.c
jni/*.cc
../mk_template/JNI_OnLoad.cpp)

list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES})

get_filename_component(EXPORT_EXP_FILE jni/export.exp ABSOLUTE)
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${EXPORT_EXP_FILE}")

//增加:
link_directories(../comm)
link_libraries(comm)
link_directories(../boost)
link_libraries(mars-boost)

endif()

相关问题