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

Error compiling #97

Open
filipemd opened this issue Nov 11, 2023 · 4 comments
Open

Error compiling #97

filipemd opened this issue Nov 11, 2023 · 4 comments

Comments

@filipemd
Copy link

Im using Intel MacOS Sonoma.

/Users/filipedelgado/Documents/minecraft-weekend/lib/cglm/src/vec4.c:127:25: error: argument 'v' of type 'vec4' (aka 'float[4]') with mismatched bound [-Werror,-Warray-parameter]
glmc_vec4_scale_as(vec4 v, float s, vec4 dest) {
                        ^
/Users/filipedelgado/Documents/minecraft-weekend/lib/cglm/src/../include/cglm/call/vec4.h:102:25: note: previously declared as 'vec3' (aka 'float[3]') here
glmc_vec4_scale_as(vec3 v, float s, vec3 dest);
                        ^
/Users/filipedelgado/Documents/minecraft-weekend/lib/cglm/src/vec4.c:127:42: error: argument 'dest' of type 'vec4' (aka 'float[4]') with mismatched bound [-Werror,-Warray-parameter]
glmc_vec4_scale_as(vec4 v, float s, vec4 dest) {
                                         ^
/Users/filipedelgado/Documents/minecraft-weekend/lib/cglm/src/../include/cglm/call/vec4.h:102:42: note: previously declared as 'vec3' (aka 'float[3]') here
glmc_vec4_scale_as(vec3 v, float s, vec3 dest);
                                         ^
2 errors generated.
make[3]: *** [CMakeFiles/cglm.dir/src/vec4.c.o] Error 1
make[2]: *** [CMakeFiles/cglm.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [libs] Error 2
@djxza
Copy link

djxza commented Nov 14, 2023

Its some sort of cmake error, in the repository only make is supported so its a linking error where cglm has been linked multiple times prob

@san475
Copy link

san475 commented Nov 25, 2023

Any updates on this issue? I have ran into the same error and am stuck.

Running Sonoma as well.

Does anyone know what is meant by mismatched bound?

@san475
Copy link

san475 commented Nov 25, 2023

Removing -Werror from line 36 of the /lib/cglm/CMakeLists.txt file and re-running cmake on it seems to have allowed me to compile the game, though I doubt it's a best practice.

@hemashushu
Copy link

For everyony who wants to compile on Arch Linux in 2024/4:

  1. modify the file ./Makefile:
diff --git a/Makefile b/Makefile
index 21fba7c..37775f2 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ CFLAGS = -std=c11 -O3 -g -Wall -Wextra -Wpedantic -Wstrict-aliasing
 CFLAGS += -Wno-pointer-arith -Wno-newline-eof -Wno-unused-parameter -Wno-gnu-statement-expression
 CFLAGS += -Wno-gnu-compound-literal-initializer -Wno-gnu-zero-variadic-macro-arguments
 CFLAGS += -Ilib/cglm/include -Ilib/glad/include -Ilib/glfw/include -Ilib/stb -Ilib/noise -fbracket-depth=1024
+CFLAGS += -Wno-error=implicit-function-declaration
 LDFLAGS = lib/glad/src/glad.o lib/cglm/libcglm.a lib/glfw/src/libglfw3.a lib/noise/libnoise.a -lm
  1. Modify the file ./lib/cglm/CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 378332b..2bd0b8e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ if(MSVC)
     string(REGEX REPLACE "/RTC(su|[1su])" "" ${flag_var} "${${flag_var}}")
   endforeach(flag_var)
 else()
-  add_compile_options(-Wall -Werror -O3)
+  add_compile_options(-Wall -Werror -Wno-error=array-bounds -Wno-error=stringop-overflow -Wno-error=array-parameter -O3)
 endif()

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

4 participants