Author Topic: Where to turn off -mwindows switch?  (Read 3781 times)

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
Where to turn off -mwindows switch?
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Where to turn off -mwindows switch?
« Reply #1 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)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Where to turn off -mwindows switch?
« Reply #2 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':|

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Where to turn off -mwindows switch?
« Reply #3 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>

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Where to turn off -mwindows switch?
« Reply #4 on: April 13, 2014, 03:05:09 pm »
Inspect the Build log not Build messages.... it might give you more clues.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Where to turn off -mwindows switch?
« Reply #5 on: April 13, 2014, 05:24:53 pm »
Did you do something stupid like add it to the global compiler settings?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Where to turn off -mwindows switch?
« Reply #6 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