Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling dont works because of redefinitions #80

Open
Benn1x opened this issue Jun 7, 2022 · 4 comments
Open

Compiling dont works because of redefinitions #80

Benn1x opened this issue Jun 7, 2022 · 4 comments

Comments

@Benn1x
Copy link

Benn1x commented Jun 7, 2022

i compiled it like this
make libs && make
and got following error:

typedef union ivec2s {
              ^
lib/cglm/include/cglm/struct/clipspace/../../types-struct.h:85:15: note: previous definition is here
typedef union ivec2s {
              ^
In file included from src/block/air.c:1:
In file included from src/block/block.h:4:
In file included from src/block/../util/util.h:25:
src/block/../util/ivec2s.h:69:3: error: typedef redefinition with different types ('union (unnamed union at src/block/../util/ivec2s.h:61:15)' vs 'union ivec2s')
} ivec2s;
@PR0BLEMCH1LD
Copy link

Just delete the definition in ivec2s.h

@bramtechs
Copy link

Try checking out cglm branch v0.8.4:

cd ./lib/cglm
git checkout v0.8.4
cd ../../
make libs
make
./bin/game

@heysokam
Copy link

heysokam commented Dec 15, 2022

Fixed by doing two things

cd ./lib/cglm
git checkout 2a4748d    # As mentioned in https://github.com/recp/cglm/issues/240
cd ../../
make libs

Editing file src/util/ivec2s.h and disabling the union type

#if 0
typedef union ivec2s {
  ivec2 raw;
#if CGLM_USE_ANONYMOUS_STRUCT
  struct {
    int x;
    int y;
  };
#endif
} ivec2s;
#endif

The game then compiles normally

@anthonywww
Copy link

I don't have clang and didn't wanna install it so I change the CC to gcc and just removed -fbracket-depth=1024 from the Makefile.

All works great, except I tried digging down for a while and this happened, not sure if it's related but cool none the less!

game: src/world/world.c:191: world_heightmap_recalculate: Assertion `world_in_bounds(self, (ivec3s) {{ p.x, 0, p.y }})' failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants