Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: lucky7456969 on April 13, 2014, 01:40:28 pm

Title: Where to turn off -mwindows switch?
Post by: lucky7456969 on April 13, 2014, 01:40:28 pm
Hi there,
Just wondering where I can turn off the -mwindows switch for mingw64?
There is a link time error and the compiler is seeking for WinMain where I am building a console application.
Thanks
Jack
Title: Re: Where to turn off -mwindows switch?
Post by: oBFusCATed on April 13, 2014, 02:00:37 pm
Project -> Properties -> Build targets -> your target -> Type -> Console application (probably it is set to native or gui)
Title: Re: Where to turn off -mwindows switch?
Post by: lucky7456969 on April 13, 2014, 02:03:08 pm
Hi oBFusCATed,
My scenario is a bit strange.
I tried both GUI and console,
But the compiler is giving me the same message, I've saved the project

Code
d:\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\4.7.2\..\..\..\..\x86_64-w64-mingw32\lib\..\lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o)||In function `main':|
Title: Re: Where to turn off -mwindows switch?
Post by: lucky7456969 on April 13, 2014, 02:48:30 pm
Sorry, I didn't mean to reply on the last post.
But here is the project file
Thanks
Jack
 
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="PerfectSimQT" />
<Option pch_mode="2" />
<Option compiler="mingw64_-_nonunicode" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/PerfectSimQT" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="mingw64_-_nonunicode" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/PerfectSimQT" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="0" />
<Option compiler="mingw64_-_nonunicode" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add directory="E:/Software/Q/qt-4.7.4/4.7.4-qt-x64/include" />
<Add directory="E:/Software/Q/qt-4.7.4/4.7.4-qt-x64/include/QtGui" />
</Compiler>
<Linker>
<Add library="QtCore4" />
<Add library="QtGui4" />
<Add directory="E:/Software/Q/qt-4.7.4/4.7.4-qt-x64/lib" />
</Linker>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
Title: Re: Where to turn off -mwindows switch?
Post by: oBFusCATed on April 13, 2014, 03:05:09 pm
Inspect the Build log not Build messages.... it might give you more clues.
Title: Re: Where to turn off -mwindows switch?
Post by: stahta01 on April 13, 2014, 05:24:53 pm
Did you do something stupid like add it to the global compiler settings?

Tim S.
Title: Re: Where to turn off -mwindows switch?
Post by: lucky7456969 on April 13, 2014, 09:34:49 pm
I got it, it was because I included the UNICODE switch in my Linker settings
Thanks
Jack