Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1004 opened this issue Aug 19, 2020 · 1 comment
Open

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

1004 opened this issue Aug 19, 2020 · 1 comment

Comments

@1004
Copy link

1004 commented Aug 19, 2020

[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!!!!!!!!!!!!!!!!!!!!

@1004 1004 changed the title 编译失败,求大佬解答 Mac 系统-编译失败,求大佬解答 Aug 19, 2020
@qingkouwei
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants