error: implicit declaration of function ‘strtof’
goog opened this issue · 4 comments
goog commented
cheng@ada ~/mpc $ make
gcc -ansi -pedantic -O3 -g -Wall -Werror -Wextra -Wformat=2 -Wshadow -Wno-long-long -Wno-overlength-strings -Wno-format-nonliteral -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Wredundant-decls -Wnested-externs -Wmissing-include-dirs -Wswitch-default examples/doge.c mpc.c -lm -o examples/doge
mpc.c: In function ‘mpcf_float’:
mpc.c:2259:3: error: implicit declaration of function ‘strtof’ [-Werror=implicit-function-declaration]
*y = strtof(x, NULL);
^
mpc.c:2259:3: error: nested extern declaration of ‘strtof’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [examples/doge] Error 1
After git clone the repo, i got the error and the <stdlib.h>
is included. i dont know why
orangeduck commented
What platform are you on? Perhaps if you remove the flags -ansi
and -pedantic
from the Makefile it might work.
goog commented
Linux
orangeduck commented
Which kind?
goog commented
Linux mint 17.3