Hello there
I am currently trying to port a C++ SDL project to web format using emscripten and clang. There are multiple source files int the project so I have attempted to create a makefile for the project. This is what I have in it.
debug:
emcc $(wildcard src/*.cpp)
-sUSE_SDL=2
-o ./out/build/x64-debug \
-lSDL2
-lSDL2_image
-lSDL2_ttf
-lSDL2_mixeremcc =02 *.o -o paultris.js ./out/build/x64-debug
When I run make I get the following output.
> emcc src/GameScreen.cpp src/Tetris.cpp src/SDLApp.cpp src/MainMenu.cpp src/Main.cpp src/Sound.cpp \
> -sUSE_SDL=2
> In file included from src/GameScreen.cpp:1:
> In file included from src/GameScreen.h:7:
> src/Text.h:2:10: fatal error: 'SDL_ttf.h' file not found
> #include <SDL_ttf.h>
> ^~~~~~~~~~~
> 1 error generated.
> emcc: error: 'C:/sdks/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -IC:\sdks\emsdk\upstream\emscripten\cache\sysroot\include\SDL2 --sysroot=C:\sdks\emsdk\upstream\emscripten\cache\sysroot -Xclang -iwithsysroot/include\compat src/GameScreen.cpp -c -o C:\Users\paulk\AppData\Local\Temp\emscripten_temp_y04p4vbz\GameScreen_0.o' failed (returned 1)
> make: *** [makefile:11: debug] Error 1

I don't know why it cannot open SDL_ttf.h as I have added the flag for it in the makefile. Is there something else that I need to type?
Regards,
OzzieKing