We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在编译生成静态库之后,使用CMakelist链接静态库时,必须按顺序链接。才能编译成功,顺序如下: add_executable(test src/main.cpp) target_link_libraries(test ${catkin_LIBRARIES} ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_main.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_log.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_terminal.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_network.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_eventx.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_event.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_util.a ${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_base.a -lpthread -ldl )
The text was updated successfully, but these errors were encountered:
target_link_libraries增加 -Wl,--start-group 和-Wl,--end-group参数可以实现随意顺序链接 set(TBOX_LIB ${TBOX_LIB_PATH}/libtbox_terminal.a ${TBOX_LIB_PATH}/libtbox_network.a ${TBOX_LIB_PATH}/libtbox_log.a ${TBOX_LIB_PATH}/libtbox_util.a ${TBOX_LIB_PATH}/libtbox_base.a ${TBOX_LIB_PATH}/libtbox_main.a ${TBOX_LIB_PATH}/libtbox_alarm.a ${TBOX_LIB_PATH}/libtbox_coroutine.a ${TBOX_LIB_PATH}/libtbox_crypto.a ${TBOX_LIB_PATH}/libtbox_dbus.a ${TBOX_LIB_PATH}/libtbox_flow.a ${TBOX_LIB_PATH}/libtbox_eventx.a ${TBOX_LIB_PATH}/libtbox_http.a ${TBOX_LIB_PATH}/libtbox_jsonrpc.a ${TBOX_LIB_PATH}/libtbox_mqtt.a ${TBOX_LIB_PATH}/libtbox_event.a
) target_link_libraries(${TARGETFILE} -Wl,--start-group pthread dl file ${crypto_LIB} ${TBOX_LIB} -Wl,--end-group)
Sorry, something went wrong.
No branches or pull requests
在编译生成静态库之后,使用CMakelist链接静态库时,必须按顺序链接。才能编译成功,顺序如下:
add_executable(test src/main.cpp)
target_link_libraries(test
${catkin_LIBRARIES}
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_main.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_log.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_terminal.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_network.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_eventx.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_event.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_util.a
${LIB_DIR_ARCH}/cpp-tbox/lib/libtbox_base.a
-lpthread
-ldl
)
The text was updated successfully, but these errors were encountered: