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

MacOS:'SDL2/SDL.h' file not found #42

Closed
TANG617 opened this issue Apr 20, 2022 · 5 comments
Closed

MacOS:'SDL2/SDL.h' file not found #42

TANG617 opened this issue Apr 20, 2022 · 5 comments

Comments

@TANG617
Copy link

TANG617 commented Apr 20, 2022

When I try to compile main.c, I encounter this problem.
The details are as follow

> Executing task: platformio run --environment emulator_64bits <

Processing emulator_64bits (platform: native@^1.1.3)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <lvgl> 8.2.0
|-- <lv_drivers> 8.2.0
|   |-- <lvgl> 8.2.0
Building in release mode
Compiling .pio/build/emulator_64bits/lib44b/lv_drivers/sdl/sdl.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_icon_2.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_icon_2_large.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_icon_3.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_icon_3_large.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_icon_4.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_icon_4_large.o
Compiling .pio/build/emulator_64bits/.pio/libdeps/emulator_64bits/lvgl/demos/music/assets/img_lv_demo_music_list_border.o
.pio/libdeps/emulator_64bits/lv_drivers/sdl/sdl.c:53:10: fatal error: 'SDL2/SDL.h' file not found
#include SDL_INCLUDE_PATH
         ^~~~~~~~~~~~~~~~
<command line>:12:26: note: expanded from here
#define SDL_INCLUDE_PATH "SDL2/SDL.h"
                         ^~~~~~~~~~~~
1 error generated.
*** [.pio/build/emulator_64bits/lib44b/lv_drivers/sdl/sdl.o] Error 1
========================== [FAILED] Took 2.36 seconds ==========================

Environment      Status    Duration
---------------  --------  ------------
emulator_64bits  FAILED    00:00:02.365
==================== 1 failed, 0 succeeded in 00:00:02.365 ====================
终端进程“platformio 'run', '--environment', 'emulator_64bits'”已终止,退出代码: 1。

终端将被任务重用,按任意键关闭。

I Found Some Solution On This Website
https://stackoverflow.com/questions/10488775/sdl-h-no-such-file-or-directory-found-when-compiling
I think it's the solution to this SDL problem, but I still don't know how to fix it.
THX for your help!

@wupeaking
Copy link

  1. brew install sdl2

  2. find header and lib path brew list sdl2
    example:
    image

  3. config plamio.ini

image

  1. enjoy it!

@puzrin
Copy link
Collaborator

puzrin commented Jun 17, 2022

@TANG617 https://github.com/lvgl/lv_platformio#install-sdl-drivers did you installed sdl as been said in readme?

@fbiego
Copy link
Collaborator

fbiego commented Sep 21, 2022

for M1, add -arch arm64

After lots of gyrations, I did manage to compile and execute this project on a Mac M1. The change was simple. Add a few items to build_flags in platformio.ini -arch arm64 -I /opt/homebrew/include -L /opt/homebrew/lib
#29 (comment)

@sslogan666
Copy link

@TANG617 I encountered the same problem on Windows 10. I fix it through the following method:

image

@TANG617 TANG617 closed this as completed Nov 12, 2022
@TANG617
Copy link
Author

TANG617 commented Dec 12, 2022

Thanks you guys a lot! I have tried the solution and problem was solved!

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

5 participants