xtreme8000 / CavEX

Project to recreate your favourite block game for the Wii (Beta 1.7.3)
GNU General Public License v3.0
225 stars 20 forks source link

Can't compile from source - C code error (MacOS) #36

Closed muyyii closed 4 months ago

muyyii commented 5 months ago

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.

xtreme8000 commented 5 months ago

can you try again now c518da4be009341f95f4c1d56d83cf0ec006160f?

muyyii commented 4 months ago

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!

muyyii commented 4 months ago

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!