replaced g++ to gcc and used C99 for gcc