AssetKit: Can't build library on linux

I am running Garuda Linux

I git clone the repository run cmake/automake as in the tutorial and i get compile errors after I run make.

Consolidate compiler generated dependencies of target ds
[  0%] Building C object deps/ds/CMakeFiles/ds.dir/src/util.c.o
/home/snake/Desktop/AssetKit/deps/ds/src/util.c: In function ‘ds_print_i64’:
/home/snake/Desktop/AssetKit/deps/ds/src/util.c:122:16: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘int64_t’ {aka ‘long int’} [-Werror=format=]
122 |   printf("\t%llu\n", *(int64_t *)key);
|             ~~~^     ~~~~~~~~~~~~~~~
|                |     |
|                |     int64_t {aka long int}
|                long long unsigned int
|             %lu
/home/snake/Desktop/AssetKit/deps/ds/src/util.c: In function ‘ds_print_ui64’:
/home/snake/Desktop/AssetKit/deps/ds/src/util.c:128:16: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Werror=format=]
128 |   printf("\t%llu\n", *(uint64_t *)key);
|             ~~~^     ~~~~~~~~~~~~~~~~
|                |     |
|                |     uint64_t {aka long unsigned int}
|                long long unsigned int
|             %lu
cc1: all warnings being treated as errors
make[2]: *** [deps/ds/CMakeFiles/ds.dir/build.make:104: deps/ds/CMakeFiles/ds.dir/src/util.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:672: deps/ds/CMakeFiles/ds.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

If I try to hand fix these errors, a bunch of errors pop up, not just warning, but errors like AK_INLINE, AkFloat3 etc.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 46 (21 by maintainers)

Most upvoted comments

Thank you for your reply @recp. I am looking forward to use this library, because assimp didn’t really work well, mostly because it’s C++(as I am writing in C) and it is very slow at linking process when I am building my project. But this seems like a solid choice.

I will be checking up on this quite frequently so you can ask me for help if needed.

Successfully builds on linux.

Okay, so the problem is that you assume if _MSC_VER is not defined that it’s linux. That’s what prevents it from building on windows under mingw because mingw obviously uses WinAPI(although there is msys but it’s hacky, why if we already have WinAPI versions). So it would be better to check against linux define rather then msvc compiler version. There’s only one place where it warns about attribute being incorrect due to config is in ds_def_alc(). If you remove that attribute (and choose correct attributes ones for mingw and not dllimport) then it will build perfectly fine.