1. Error on compiling; with gcc/msys2

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 

new topic     » topic index » view message » categorize

2. Re: Error on compiling; with gcc/msys2

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 

new topic     » goto parent     » topic index » view message » categorize

3. Re: Error on compiling; with gcc/msys2

Next problem ... linking.

C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphor 
ia/4.1/bin/eu.a(be_w.o):be_w.c:(.text+0xb00): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphor 
ia/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0xd11): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0xdcb): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0x2f30): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0x4031): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0x406b): more undefined references to `__imp___iob_func' follow 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.rdata$.refptr.__imp___argv[.refptr.__imp___argv]+0x0): undefined ref 
erence to `__imp___argv'                                                                                         C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphor 
ia/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.rdata$.refptr.__imp___argc[.refptr.__imp___argc]+0x0): undefined reference to `__imp___argc'                                                                                         collect2.exe: error: ld returned 1 exit status 
Unable to link C:\bin\WEE\wee.exe                                                                                Status: 1 Command: gcc -o C:/bin/WEE/wee.exe  init-.o wee.o main-.o parser.o filesys.o datetime.o dll.o error.o machine.o memconst.o memory.o types.o get.o io.o text.o convert.o search.o math.o rand.o pretty.o sequence.o sort. 
o serialize.o scinot.o map.o eumem.o scintilla.o ui_win.o window.o   C:/bin/Euphoria/4.1/bin/eu.a -m64 

new topic     » goto parent     » topic index » view message » categorize

4. Re: Error on compiling; with gcc/msys2

mitgedanken said...

Next problem ... linking.

C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphor 
ia/4.1/bin/eu.a(be_w.o):be_w.c:(.text+0xb00): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphor 
ia/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0xd11): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0xdcb): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0x2f30): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0x4031): undefined reference to `__imp___iob_func' 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.text+0x406b): more undefined references to `__imp___iob_func' follow 
C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphoria/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.rdata$.refptr.__imp___argv[.refptr.__imp___argv]+0x0): undefined ref 
erence to `__imp___argv'                                                                                         C:/msys2/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/bin/Euphor 
ia/4.1/bin/eu.a(be_runtime.o):be_runtime.c:(.rdata$.refptr.__imp___argc[.refptr.__imp___argc]+0x0): undefined reference to `__imp___argc'                                                                                         collect2.exe: error: ld returned 1 exit status 
Unable to link C:\bin\WEE\wee.exe                                                                                Status: 1 Command: gcc -o C:/bin/WEE/wee.exe  init-.o wee.o main-.o parser.o filesys.o datetime.o dll.o error.o machine.o memconst.o memory.o types.o get.o io.o text.o convert.o search.o math.o rand.o pretty.o sequence.o sort. 
o serialize.o scinot.o map.o eumem.o scintilla.o ui_win.o window.o   C:/bin/Euphoria/4.1/bin/eu.a -m64 

I'm not familiar with msys2 or ucrt64. But from what I can tell, the linker isn't finding something. Unless you need this setup for other reasons, I'd just download w64devkit and use it (no installation required) just keep in mind that the 32bit and 64bit versions are two different packages. That's usually faster than spending hours trying to find errors in the setup.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Error on compiling; with gcc/msys2

Thank you. All problems are gone.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu