vulkan-guide
vulkan-guide copied to clipboard
Trying to compile Engine branch but get errors
third-party/imgui/imgui_impl_sdl.cpp:50:10: fatal error: SDL.h: No such file or directory
50 | #include <SDL.h>
| ^~~~~~~
compilation terminated.
make[2]: *** [third-party/CMakeFiles/imgui.dir/build.make:160: third-party/CMakeFiles/imgui.dir/imgui/imgui_impl_sdl.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:392: third-party/CMakeFiles/imgui.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
not sure if this it the most elegant solution however, to circumvent this I have added
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
to the CMakeLists.txt root file.
This however results in another error:
make[2]: *** No rule to make target '../libs/Release/nvtt.lib', needed by 'baker'. Stop.
make[1]: *** [CMakeFiles/Makefile2:446: asset-baker/CMakeFiles/baker.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
my limited knowledge of CMake isn't helping me ... from what I can read the target_link_libraries from nvtt should automatically include the paths for the library and headers .... I have tried to force it by including them in the asset-baker CMakeLists.txt file ... it works for the library path but not for the headers... which is resulting in:
asset-baker/asset_main.cpp:22:10: fatal error: nvtt.h: No such file or directory
22 | #include <nvtt.h>
... ran out of ideas for now...
Also, .. forgot to mention .. there is a compile error:
ssetlib/asset_loader.cpp:70:13: error: ‘strcmp’ was not declared in this scope
70 | if (strcmp(f, "LZ4") == 0)
that you can easily fix by including the required header
and I also had some issue with the itoa function calls on asset-baker/asset_main.cpp ... those require replacing as well.
+1 i'm hitting the same issue
@Gunnl , @tysonmalchow what platform are you using it from? The code was checked for compile in visual studio, but maybe the problem is in clang or gcc.
Yeah... i found it that later... I am running linux (arch linux) ... I decided to drop the comment anyway, perhaps will help someone in future...
if you do not wish to use include_directories, you can also simply do SDL2/sdl.h
instead
ninja: error: '../libs/Debug/nvtt.lib', needed by '../bin/baker.exe', missing and no known rule to make it I got the same error ,can't run the engine branch,how did you solve it ?
I got the error whe I try to run exra exe on windows : [00:00]?[38;2;255;255;255m[INFO] ?[0mEngine Init [00:00.002]?[38;2;144;238;144m[SUCCESS] ?[0mSDL inited [00:01.361]?[38;2;144;238;144m[SUCCESS] ?[0mVulkan Instance initialized [00:01.362]?[38;2;144;238;144m[SUCCESS] ?[0mSDL Surface initialized [00:01.371]?[38;2;144;238;144m[SUCCESS] ?[0mGPU found [00:01.459]?[38;2;255;255;255m[INFO] ?[0mThe gpu has a minimum buffer alignement of 64 [00:01.531]?[38;2;255;255;255m[INFO] ?[0mEngine Initialized, starting Load Error when loading texture ../../assets_export/Sponza/white.tx [00:01.532]?[38;2;220;020;060m[ERROR] ?[0mError When texture white at path ../../assets_export/Sponza/white.tx [00:01.533]?[38;2;255;255;255m[INFO] ?[0mBuilt New Material textured [00:01.533]?[1m?[38;2;220;020;060m[FATAL] ?[0mError When loading prefab file at path ../../assets_export/FlightHelmet/ FlightHelmet.pfb
So I supposed I should use the baker to exe to export asset ? but the baker won't run
Unfortunately, I have same error as OP and I am trying to use VSCode on Widows 11. I did not install SDL separately, but I see it is installed with Vulkan. Do I need to do anything extra to install SDL?
For anyone having similar issue with VSCode and SDL, those are steps to make it working:
- Download
SDL-devel-x.xx.x-VC
file and extract it. - Copy
..cmake\sdl2-config.cmake
to root. - Update line
set(sdl2_DIR "SDL_PATH" CACHE FILEPATH "Path to SDL2")
inthird_party\CMakeLists.txt
invulkan-guide
. Now you should be able to compile.
For example:
- I downloaded SDL2-devel-2.30.1-VC version
- Copied
sdl2-config.cmake
fromC:\Users\some_user\Downloads\SDL2-devel-2.30.1-VC\SDL2-2.30.1\cmake
toC:\Users\some_user\Downloads\SDL2-devel-2.30.1-VC\SDL2-2.30.1
- Update line
set(sdl2_DIR "SDL_PATH" CACHE FILEPATH "Path to SDL2")
inthird_party\CMakeLists.txt
invulkan-guide
to look likeset(sdl2_DIR "C:/Users/some_user/Downloads/SDL2-devel-2.30.1-VC/SDL2-2.30.1" CACHE PATH "Path to SDL2")
@dsvua the engine branch is heavily outdated, i dont recomend trying to make it run, and its missing the assets. I havent removed it only because it contains the shaders for the gpu-driven chapter
Thank you. I switched to all-chapters-1.3-wip
and so far so good. No need for manual changes as it already have SDL in third-party folder.