Я пытаюсь скомпилировать плагин GStreamer. Я могу успешно скомпилировать на linux, но не удается использовать тот же CMakeLists.txt в кросс-компиляторе Cerbero.
CMakeLists.txt:
project(gst-plugin)
cmake_minimum_required(VERSION 3.13)
set(TARGET_NAME "gstplugin")
find_package(GStreamer REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB2 glib-2.0 REQUIRED)
message(glib include dirs: "${GLIB2_INCLUDE_DIRS}")
message(glib libs: "${GLIB2_LIBRARIES}")
file(GLOB MAIN_SRC
${CMAKE_CURRENT_SOURCE_DIR}/*.c
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
file(GLOB MAIN_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/*.h
)
add_library(${TARGET_NAME} SHARED ${MAIN_SRC} ${MAIN_HEADERS})
target_include_directories(${TARGET_NAME}
PUBLIC
${GSTREAMER_INCLUDE_DIRS}
${GSTREAMER_BASE_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(${TARGET_NAME}
PUBLIC
${GSTREAMER_LIBRARIES}
${GSTREAMER_BASE_LIBRARIES}
${GSTREAMER_VIDEO_LIBRARIES}
${GLIB2_LIBRARIES}
)
Вывод двух строк сообщения:
glibincludedirs:/home/cerbero/build/dist/android_armv7/include/glib-2.0;/home/cerbero/build/dist/android_armv7/lib/glib-2.0/include
gliblibs:glib-2.0;intl
Когда я звоню make, я получаю следующие ошибки:
[ 50%] Linking CXX shared library libgstplugin.so
/home/git/gstplugin/gstplugin.cpp:96: error: undefined reference to 'g_type_register_static_simple'
/home/git/gstplugin/gstplugin.cpp:96: error: undefined reference to 'g_type_class_peek_parent'
/home/git/gstplugin/gstplugin.cpp:96: error: undefined reference to 'g_type_class_adjust_private_offset'
/home/git/gstplugin/gstplugin.cpp:104: error: undefined reference to 'g_type_check_class_cast'
/home/git/gstplugin/gstplugin.cpp:132: error: undefined reference to 'g_type_check_instance_cast'
/home/git/gstplugin/gstplugin.cpp:133: error: undefined reference to 'g_type_check_instance_cast'
/home/git/gstplugin/gstplugin.cpp:141: error: undefined reference to 'g_type_check_instance_cast'
/home/git/gstplugin/gstplugin.cpp:148: error: undefined reference to 'g_type_check_class_cast'
/home/git/gstplugin/gstplugin.cpp:153: error: undefined reference to 'g_type_check_instance_cast'
/home/git/gstplugin/gstplugin.cpp:163: error: undefined reference to 'g_type_check_class_cast'
/home/git/gstplugin/gstplugin.cpp:438: error: undefined reference to 'g_type_check_class_cast'