Can't compile from source - C code error (MacOS)
muyyii opened this issue · 3 comments
As for today Feb 6 2024. Latest master branch plus recommended libraries.
build_pc % make
[ 0%] Building C object CMakeFiles/cavex.dir/source/block/aabb.c.o
[ 1%] Building C object CMakeFiles/cavex.dir/source/block/block_bed.c.o
In file included from ~/Documents/CODE/REPOS/CavEX/source/block/block_bed.c:20:
In file included from ~/Documents/CODE/REPOS/CavEX/source/block/../block/blocks.h:30:
~/Documents/CODE/REPOS/CavEX/source/block/../game/../world.h:62:10: error: field has incomplete type 'ptime_t' (aka 'struct timespec')
ptime_t anim_timer;
^
~/Documents/CODE/REPOS/CavEX/source/block/../platform/time.h:30:16: note: forward declaration of 'struct timespec'
typedef struct timespec ptime_t;
^
1 error generated.
make[2]: *** [CMakeFiles/cavex.dir/source/block/block_bed.c.o] Error 1
make[1]: *** [CMakeFiles/cavex.dir/all] Error 2
make: *** [all] Error 2
Should I try an older version of the repo? or there is something I'm doing wrong maybe a library I didn't correctly attached?... should I start hand correcting the source code?
Thanks in advance.
can you try again now c518da4?
can you try again now c518da4?
Perfect! also I'll add what I found so if anyone finds similar issues as mine.
If you are compiling in macOS replace #include <malloc.h>
with #include <stdlib.h>
Oh and btw I noticed in [c518da4] in /source/platform/pc/gfx.c line 372:
switch(func) { case MODE_FRONT: glCullFace(GL_FRONT); break; case MODE_BACK: glCullFace(GL_BACK); break; default: }
I solved adding at the end of "default:" a ";". I assume you are still working on that file. I was wondering do you use often the PC build for debugging? what kind of input is working?
Thanks a lot for the help and the quick answer, btw this work is really impressive!
Okey one more thing, I found out you got to copy config_pc.json from the main folder and rename it config.json into the build_pc folder! rookie mistake, maybe a mention in the README.md could help a bit.
Thanks again!