-
Notifications
You must be signed in to change notification settings - Fork 169
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
error : definition is marked dllimport using lvgl_thorvg #46
Comments
Last time we saw a dll import issue @kdschlosser investigated it. Kevin, do you know what can be the problem with ThorVG? |
Can you paste the compiler output into a post for me so I can see what is happening? |
all api in thorvg are show error as follow : lvgl-9.1.0\src\libs\thorvg\tvgCapi.cpp:498:20: error: function 'Tvg_Result tvg_shape_get_gradient(const Tvg_Paint*, Tvg_Gradient**)' definition is marked dllimport |
and this is my cmake file written : find_package(SDL2 2.30.4 PATHS ${SDL2_RELEASE_DIR}) message(STATUS "SDL2_DIR = ${SDL2_DIR}") MESSAGE(STATUS "project_source" "${PROJECT_SOURCE_DIR}") set(LVGL_SRC_DIR ${ROOT_PATH}/source/thirdparty/lvgl) option(LV_USE_DRAW_SDL "Use SDL draw unit" OFF) MESSAGE(STATUS "lvgl source dir: ${LVGL_SRC_DIR}-${LVGL_VERSION}") add_subdirectory(lvgl_sim_src) in lvgl_sim_src directory 's CMakeLists.txt is : target_include_directories(lvgl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${LVGL_SRC_DIR}-${LVGL_VERSION} ${SDL2_INCLUDE_DIRS}) add_executable(lvgl_main main.c mouse_cursor_icon.c) add_custom_command(TARGET lvgl_main POST_BUILD |
It's easy to locate the issue... This is the compiler output
searching for the function thorvg_capi.h TVG_API Tvg_Result tvg_canvas_destroy(Tvg_Canvas* canvas); tvgCapi.cpp TVG_API Tvg_Result tvg_canvas_destroy(Tvg_Canvas* canvas)
{
if (!canvas) return TVG_RESULT_INVALID_ARGUMENT;
delete(reinterpret_cast<Canvas*>(canvas));
return TVG_RESULT_SUCCESS;
} and when we look up what TVG_API is this is what is found in thorvg_capi.h
and there you have it. an undocumented macro.. |
add |
i had add -DTVG_BUILD=1 and the error still happened, here is my modified :
|
@kdschlosser |
That is going to be in @kisvegabor 's court to help you. I know the build systems and documentation. LVGL's inner workings are not my strong area especially the vector graphics stuff. |
Awesome! Please try modifying this part to target_compile_definitions(lvgl
INTERFACE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\)
PRIVATE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\)
PRIVATE TVG_BUILD=1
) |
Hi,
in windows, i use cmake with mingW compile successful except lvgl_thorvg;
but using LV_CONF_BUILD_DISABLE_THORVG_INTERNAL = ON to enable lvgl_thorvg ,
it compile error with "definition is marked dllimport ".
how can i fix it ?
The text was updated successfully, but these errors were encountered: