-
Notifications
You must be signed in to change notification settings - Fork 160
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
SDL2 does not work #57
Comments
Please share your lv_conf.h and main.c. How did you compile the project? |
[main] Building folder: /home/ubuntu/Desktop/lvgl/build I tested under ubuntu20.04 , installed SDL2, error。 |
Have you installed SDL like this:
|
I removed the if().... .elseif()... .endif. and it works! cmake_minimum_required(VERSION 3.10)
project(lvgl)
#Uncomment if the program needs debugging
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -ggdb")
set(CMAKE_C_STANDARD 99) # LVGL officially supports C99 and above
set(CMAKE_CXX_STANDARD 17) #C17
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
add_subdirectory(lvgl)
target_include_directories(lvgl PUBLIC ${PROJECT_SOURCE_DIR})
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(SDL2_image REQUIRED SDL2_image)
target_include_directories(lvgl PRIVATE ${SDL2_INCLUDE_DIRS})
target_include_directories(lvgl PRIVATE ${SDL2_IMAGE_INCLUDE_DIRS})
add_executable(lvglsim main.c mouse_cursor_icon.c)
target_link_libraries(lvglsim lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} m pthread)
add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/lvglsim DEPENDS lvglsim) |
I've just tried it out and could reproduce the issue. You should call CMake like this: It's something that we really should document. There is also an LVGL issue to make CMake handling more unified. @etag4048 will work on it soon. |
I tested under debian12, error occurred during startup, Segmentation fault.
The text was updated successfully, but these errors were encountered: