Using different MinGW version problem

General questions regarding the usage of CodeLite
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

I build the wxWidgets using the same version of mingw x64 (4.9.1) as the one i am using to compile the project. The command for building wxwidgets was:

mingw32-make -j4 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=debug VENDOR=cl CXXFLAGS=”-fno-keep-inline-dllexport”

i did also #define wxUSE_GRAPHICS_CONTEXT 1 before building.

The project compiles with no problem. This is the output of the build, it's just the default project created by codelite, nothing more:
C:\Windows\system32\cmd.exe /c "X:/MyPrograms/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile"
"----------Building project:[ testwxwidget - Release ]----------"
mingw32-make.exe[1]: Entering directory 'X:/MyPrograms/testwxwidget' X:/MyPrograms/MinGW/bin/windres.exe -i "X:/MyPrograms/_Learning_Applications/C++/testwxwidget/win_resources.rc" --use-temp-file --define __WXMSW__ --define __WXDEBUG__ --define _UNICODE --include-dir X:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/lib/gcc_dll/mswud --include-dir X:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/include --define WXUSINGDLL -o ./Release/win_resources.rc.o
X:/MyPrograms/MinGW/bin/g++.exe -c "X:/MyPrograms/_Learning_Applications/C++/testwxwidget/wxcrafter.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/lib/gcc_dll/mswud -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -DNDEBUG -o ./Release/wxcrafter.cpp.o -IX:/MyPrograms/MinGW/include -I. -I.
X:/MyPrograms/MinGW/bin/windres.exe: warning: 24: 1: 1033: duplicate value
X:/MyPrograms/MinGW/bin/g++.exe -c "X:/MyPrograms/testwxwidget/wxcrafter_bitmaps.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/lib/gcc_dll/mswud -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -DNDEBUG -o ./Release/wxcrafter_bitmaps.cpp.o -IX:/MyPrograms/MinGW/include -I. -I.
X:/MyPrograms/MinGW/bin/g++.exe -c "X:/MyPrograms/testwxwidget/MainFrame.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/lib/gcc_dll/mswud -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -DNDEBUG -o ./Release/MainFrame.cpp.o -IX:/MyPrograms/MinGW/include -I. -I.
X:/MyPrograms/MinGW/bin/g++.exe -c "X:/MyPrograms/testwxwidget/main.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/lib/gcc_dll/mswud -IX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -DNDEBUG -o ./Release/main.cpp.o -IX:/MyPrograms/MinGW/include -I. -I.
X:/MyPrograms/MinGW/bin/g++.exe -o ./Release/testwxwidget @"testwxwidget.txt" -LX:/MyPrograms/MinGW/lib -L. -static-libstdc++ -static-libgcc -static -mwindows -mthreads -LX:/MyPrograms/Dev/wxWidgets-3.0.2-64x4.9.1/lib/gcc_dll -lwxmsw30ud_richtext -lwxmsw30ud_xrc -lwxmsw30ud_aui -lwxmsw30ud_html -lwxmsw30ud_adv -lwxmsw30ud_core -lwxbase30ud_xml -lwxbase30ud_net -lwxbase30ud -lwxscintillad -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexud -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
mingw32-make.exe[1]: Leaving directory 'X:/MyPrograms/testwxwidget'
0 errors, 0 warnings
But when i run it (Debug or Release mode does the same) i get "Debugger exited with the following error string: During startup program exited with code 0xc0000135"

the produced .exe file depends on a 32 bit version of COMCLT32.DLL, this should have been the 64bit version!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

But when i run it (Debug or Release mode does the same) i get "Debugger exited with the following error string: During startup program exited with code 0xc0000135"
The term here: "debugging" hitting F5 starts the debugger, the error you received means that you are using wrong debugger (do this: settings->gdb settings->debugger path and select the gdb that comes with your toolchain)

To run the executable without the debugger, hit Ctrl-F5 (or from the menu: Build->Run)

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

Hi Eran,

just found the problem! Since there is no option in codelite for determining whether the target is x64 or x86 the default project sets in win_resource.rc to include the x86 manifest! If i change the value to:

1 24 "wx/msw/amd64.manifest"

then the compiled program runs and i verified with Dependency Walker that all DLLs are x64!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

nezos wrote:just found the problem! Since there is no option in codelite for determining whether the target is x64 or x86 the default project sets in win_resource.rc to include the x86 manifest! If i change the value to:
1 24 "wx/msw/amd64.manifest"
Thanks for spotting this, I will make sure it will get fixed before codelite 7.0

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by eranif »

This is now fixed, I updated the template resource file, so it now contains:

Code: Select all

#include "wx/msw/wx.rc"
#ifdef WIN64
1 24 "wx/msw/amd64.manifest"
#else
1 24 "wx/msw/wx.manifest"
#endif
I believe that this is enough to make it work on both 32 and 64 bits

Eran
Make sure you have read the HOW TO POST thread
nezos
CodeLite Veteran
Posts: 59
Joined: Wed Dec 31, 2014 6:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Using different MinGW version problem

Post by nezos »

Works great!
Post Reply