Re: Error on compiling; with gcc/msys2
- Posted by andreasWagner 1 week ago
- 167 views
mitgedanken said...
When I try to compile a program, I get a conflict error.
Compiling with GCC
Compiling 1% init-.c
init-.c: In function 'init_literal':
init-.c:6879:19: error: conflicting types for 'sqrt'; have 'double(void)'
6879 | extern double sqrt();
| ^~~~
In file included from C:/.bin/Euphoria/4.1/include/euphoria.h:17,
from init-.c:1:
C:/msys2/ucrt64/include/math.h:196:18: note: previous declaration of 'sqrt' with type 'double(double)'
196 | double __cdecl sqrt(double _X);
| ^~~~
Couldn't compile file 'init-.c'
Status: 1 Command: gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m64 -IC:/BIN~1/Euphoria/4.1 -ffa
st-math init-.c
I'm not entirely sure, but I encountered these errors when I was using w64devkit. These errors didn't occur with tdm-gcc.
It's probably because w64devkit uses a newer version of GCC. euphoria.h is a bit outdated, as is the generated code.
This entry in eu.cfg helped me:
[translate] -extra-cflags -std=gnu89
This might work as well:(but the first version is better))
[translate] -extra-cflags -fpermissiv

