I need to change linker default option, i need to replace -mwindows with -mi386pe, because i get linker error, when i link with -mwindows:
make.exe -f "C:\Dev-Cpp\Projekty\Makefile.win" all
g++.exe main.o -o "Projekt1.exe" -L"C:/Dev-Cpp/lib" -L"C:/Qt/4.3.4/lib" -L"" -mwindows ../../Qt/4.3.4/lib/libQtCore4.a ../../Qt/4.3.4/lib/libQtGui4.a ../../Qt/4.3.4/lib/libqtmain.a
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: unrecognised emulation mode: windows
Supported emulations: i386pe
collect2: ld returned 1 exit status
make.exe: *** [Projekt1.exe] Error 1
How can i do this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not sure if you have diagnosed your problem correctly. The -mwindows option causes the console window to be suppressed and is used for GUI apps and applications with no visible UI. It works for everyone else, so I am guessing that you have changed the linker? If not I suspect some other problem.
If on the other hand you do in fact know what you are doing, the -mwindows option is placed in the linker command line when you specify that your application is a Win32 GUI. That is the only change it makes, so if you specify a Console App, the option is removed, and you can place it or any other mode option manually in the linker settings box.
In general if you write GUI code but remove the -mwindows option , you will get both a Console Window, and any GUI windows your application makes visible with ShowWindow(). Of course if you are using Qt, then it will be some higher level call that causes the Window to appear.
Either way I am willing to bet that you will not get what you expected if you think that you need -mi386pe simply because of the error message "Supported emulations: i386pe". Something just looks wrong here.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to change linker default option, i need to replace -mwindows with -mi386pe, because i get linker error, when i link with -mwindows:
make.exe -f "C:\Dev-Cpp\Projekty\Makefile.win" all
g++.exe main.o -o "Projekt1.exe" -L"C:/Dev-Cpp/lib" -L"C:/Qt/4.3.4/lib" -L"" -mwindows ../../Qt/4.3.4/lib/libQtCore4.a ../../Qt/4.3.4/lib/libQtGui4.a ../../Qt/4.3.4/lib/libqtmain.a
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: unrecognised emulation mode: windows
Supported emulations: i386pe
collect2: ld returned 1 exit status
make.exe: *** [Projekt1.exe] Error 1
How can i do this?
I am not sure if you have diagnosed your problem correctly. The -mwindows option causes the console window to be suppressed and is used for GUI apps and applications with no visible UI. It works for everyone else, so I am guessing that you have changed the linker? If not I suspect some other problem.
If on the other hand you do in fact know what you are doing, the -mwindows option is placed in the linker command line when you specify that your application is a Win32 GUI. That is the only change it makes, so if you specify a Console App, the option is removed, and you can place it or any other mode option manually in the linker settings box.
In general if you write GUI code but remove the -mwindows option , you will get both a Console Window, and any GUI windows your application makes visible with ShowWindow(). Of course if you are using Qt, then it will be some higher level call that causes the Window to appear.
Either way I am willing to bet that you will not get what you expected if you think that you need -mi386pe simply because of the error message "Supported emulations: i386pe". Something just looks wrong here.
Clifford