OptionWinGUI must be used only if the target is a GUI application. If used for console targets, result of linking is broken.
Proposed patch:
diff --git a/src/cbproject.cpp b/src/cbproject.cpp
index 855a8da..fc990ff 100644
--- a/src/cbproject.cpp
+++ b/src/cbproject.cpp
@@ -1151,7 +1151,7 @@ bool CCodeBlocksProject::GenerateMakefile
//
// platform check is disabled to allow cross-platform builds
//if ((pl->OS()==CPlatform::OS_Windows) && (target->Type()==CBuildTarget::ttExecutable))
- if (!linker->OptionWinGUI().IsEmpty())
+ if ((target->Type()==CBuildTarget::ttExecutable) && !linker->OptionWinGUI().IsEmpty())
{
CVariable& v = cmd_args.VarNamed(TPL_LNK_OPTIONS);
v.SetString(v.GetString()+" "+linker->OptionWinGUI());
OptionWinGUImust be used only if the target is a GUI application. If used for console targets, result of linking is broken.Proposed patch: