Euphoria Ticket #732: minGW -con option is forced in translate

when you translate -con option is forced because -mwindows is not added to LFLAGS

-cflags "-mwindows otherstuff" doesn't work 
look at the makefile with  
euc -keep  -gcc  -build-dir objs -makefile  

this has always been a problem. it was reported awhile ago on the forum, I tried to fix it at that time but had no luck.

include std/win32/msgbox.e  
message_box("has console?", "test !-con ", MB_OKCANCEL)  

euc testcon.ex 
should create an exe that has no console. 
euc.exe -lflags "-mwindows eu.a -m32" -gcc testcon.ex 
does work 


Type: Bug Report Severity: Minor Category: Translator
Assigned To: SDPringle Status: Fixed Reported Release: 4.0.3
Fixed in SVN #: View VCS: none Milestone: 4.0.4

1. Comment by SDPringle Dec 03, 2011

please check if euc.exe has a '-con' option in an eu.cfg. Especially, if the translator is being run from the directory you should find a '-con' option there. Without it, all of the tests run in their own Window and the tests fail.

2. Comment by ne1uno Dec 03, 2011

I never noticed the -con option in the build cfg's before, and don't recall having a problem in my own use of eutest but maybe some of the eu4 build tests are different.

it's still a problem using other cfg w/o -con

this fix works buildsys.e

		if not con_option then 
			c_flags &= " -mwindows" 
		end if 
and add at 
	elsif TWINDOWS then 
		if mno_cygwin then 
			l_flags &= " -mno-cygwin" 
		end if 
		if not con_option then 
			l_flags &= " -mwindows" 
		end if 

does -mno-cygwin need to be in both cflags & lflags?

3. Comment by SDPringle Dec 03, 2011

Confirming this for myself. Just as you said. One has to open this using explorer to appreciate this problem. After building in this way, and opening the EXE in explorer a console is created even though you don't specify a -con option.

4. Comment by ne1uno Dec 04, 2011

my posted code must not be a complete fix: or there are still problems in eu.cfg handling.

  • can still create a no console exe in the build dir where eu.cfg has -con that shouldn't be possible after reading Shawns comments above.
  • get error for missing eudbg.a picked up from another eu.cfg I am not sure about this one. (fix from a recent ticket)
  • looking at the generated -makefile have -mwindows in cflags & lflags I can't see how that is happening

built with: 
 Euphoria Interpreter v4.0.4 development 
   Windows, Using System Memory 
   Revision Date: 2011-11-22 20:20:35, Id: 5276:79e852f77415 
Euphoria Interpreter v4.1.0 development 
   32-bit Windows, Using System Memory 
   Revision Date: 2011-12-01 01:50:28, Id: 5299:ffa36080c2ac 

5. Comment by ne1uno Dec 04, 2011


  • -con in eu.cfg does prevent a non console executable
  • makefile is created as expected lflags &= -mwindows with the above patch.

sorry, was rerunning the same batch file used to test setting -cflags and -lflags from the commandline and getting the same results each time!

6. Comment by SDPringle Dec 04, 2011

This is a flag for the linker. It is not for the compiler proper. The mno-cygwin flag has no effect unless you are running in the cygwin shell under windows to compile your software. In this case you must supply the flag if you want your programs to run on systems that do not have cygwin installed.

7. Comment by SDPringle Dec 04, 2011

See: hg:euphoria/rev/f0daef301926

changeset: 5301:f0daef301926 branch: 4.0 user: Shawn Pringle <> date: Sun Dec 04 08:39:38 2011 -0300 files: source/buildsys.e description:

  • fixes ticket 732


Quick Links

User menu

Not signed in.

Misc Menu