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

fatal error: SDL2/SDL.h: No such file or directory #60

Closed
Joaquin500 opened this issue Jan 31, 2024 · 10 comments
Closed

fatal error: SDL2/SDL.h: No such file or directory #60

Joaquin500 opened this issue Jan 31, 2024 · 10 comments

Comments

@Joaquin500
Copy link

Executing task: C:\Users\Joaquin.platformio\penv\Scripts\platformio.exe run --target execute --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
Building in release mode
Compiling .pio\build\emulator_64bits\lib58c\lv_drivers\sdl\sdl.o
: fatal error: SDL2/SDL.h: No such file or directory
compilation terminated.

Any help would be more than welcome, as I'm a newbie with all these tools.

@kisvegabor
Copy link
Member

Hi,

Have you seen installed SDL?

@Joaquin500
Copy link
Author

Hi,

The only place I see SDL2 is in C:\msys64\mingw64\include\SDL2.

NOTE: In the installation process I have skiped the step "https://github.com/lvgl/lv_platformio?tab=readme-ov-file#install-sdl-drivers" because it seems to be for Linux, and I'm using Windows. Anyway, my Terminal doesn't recognize the "sudo" command.

@kisvegabor
Copy link
Member

kisvegabor commented Feb 1, 2024

This guide can be helpful to install SDL on Windows: https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/index.php

@Joaquin500
Copy link
Author

Thank you for your help and interest kisvegabor. I have followed the guide and installed SDL (which I think I had already did with MYS32). Then I changed the build_flag -D SDL_INCLUDE_PATH in platformio.ini to -D SDL_INCLUDE_PATH=""C:\vclib\SDL2-2.30.0\include\SDL.h"", and now it finds the elusive SDL.h

But, now I get the following error:

Linking .pio\build\emulator_64bits\program.exe
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2: No such file or directory
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\emulator_64bits\program.exe] Error 1

Well, obviously this task is far beyond my level, so I'm giving up with it. Again, thank you very much for your efforts trying to solve my issues.

J.

@kisvegabor
Copy link
Member

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2: No such file or directory

It indicates that SDL2 is not installed or not seen by PlatformIO.

@Joaquin500
Copy link
Author

I have it installed in 2 different places and both paths added to the PATH enviroment variable as indicated. Any way, I have given up and cleaned it all. Once again, thank you for your advice :-)

@kisvegabor
Copy link
Member

I'm sorry that we couldn't figure it out 🙁

@lgrosbois-AtlasLaser
Copy link

Hello !

I ran into the same issue.
I have several toolchains installed.

As this repo uses mingw-w64-x86_64-gcc for which SDL2 is installed, you need to ensure you do compile with this Toolchain.

==> When you open the project in vscode / platformIo extension, it creates a .vscode/c_cpp_properties.json. You need to ensure you have this value:
"compilerPath": "C:/msys64/mingw64/bin/gcc.exe",

@Joaquin500
Copy link
Author

Thank you for your feedback. As I said in my last post, I have given up with this, but I'm sure that your post will be useful for other users that run into the same problem.

@lgrosbois-AtlasLaser
Copy link

No problem.
My post was mainly to store somewhere the resolution of the issue I had.
First developer reflex is to google the error, so finding a hint to resolution is always a good sign :)

Have a good day 👍

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

3 participants