Implicit declaration of function is invalid in C99 - error when installing software on macOS

166 views Asked by At

I am trying to install Elmer FEM software on my MacOS 12.6. I use: XCode Version 14.0.1 (14A400) Apple clang version 14.0.0 (clang-1400.0.29.102) GNU Fortran (Homebrew GCC 13.2.0) 13.2.0

I followed the instructions for installation and compilation, and keep getting this error:

/Users/victor/elmer/elmerfem/fem/src/Load.c:591:3: error: implicit declaration of function 'var_copy_transpose' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  var_copy_transpose(name,values,*nrows,*ncols);
  ^
1 error generated.
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/Load.c.o] Error 1

When googleing this question, the standard tipp is to include <stdlib.h> and try to declare the function before its first use. Both is the case, and it can't be a problem with the Load.c file itself because thousands of people are using it and it works. So there must be a problem with my compiler or so... Has somebody an idea how to solve this problem? I'm already spending days to install it... Thank you so much!

Paths (gcc alias and cc alias) in .bash_profile are set (from instructions):

    export PATH=$PATH:/usr/local/Cellar/gcc/
    alias gcc='gcc-10'
    alias cc='gcc-10'

macports is deleted for now because there arose an error (homebrew and macports prefix, "define one of them")

0

There are 0 answers