Problem porting to Windows
Posted: Tue Aug 23, 2016 6:30 am
I have been having some difficulty with a project I have ported from Linux 14.04 to Windows 7.1. In both cases I am using a private build of wxWidgets 3.1.On Linux everything is fine. On Windows, using Codelite 9.1 my project builds without incident (lots of warnings from the TDM compiler, mostly deprecations in the libs), but when I do a Release->Run a terminal window pops up even though the project is marked as a GUI project. The program runs properly in every way, but when I do File->Exit or System->Close, I get the Windows error message "Program.exe has stopped working" and have to select "Close the Program" to exit.
I cannot seem to find any settings to get Codelite to do a degug build (though I am using customized settings to do the Release build just fine). So I have used wxMessageBoxes and systematic exclusion of code with comments to narrow down the source of the behavior to one of two instances of a grid control. In one case it behaves correctly, in another it behaves on shutdown as if pointers are not getting cleaned up. I cannot see a meaningful difference in the two bits of code.
But what really bothers me is the terminal window that pops up behind the app's window. Even if I take the executable and move it into its own folder and put the wxmsw310u_gcc_cl.dll with it and execute it, I get the terminal window. All I can think of is that there is some problem in my build of wxWidgets. I followed the instructions from the CodeLite Wiki...
The code back ports to Linux without any issue.
The Build log looks like this:
I cannot seem to find any settings to get Codelite to do a degug build (though I am using customized settings to do the Release build just fine). So I have used wxMessageBoxes and systematic exclusion of code with comments to narrow down the source of the behavior to one of two instances of a grid control. In one case it behaves correctly, in another it behaves on shutdown as if pointers are not getting cleaned up. I cannot see a meaningful difference in the two bits of code.
But what really bothers me is the terminal window that pops up behind the app's window. Even if I take the executable and move it into its own folder and put the wxmsw310u_gcc_cl.dll with it and execute it, I get the terminal window. All I can think of is that there is some problem in my build of wxWidgets. I followed the instructions from the CodeLite Wiki...
The code back ports to Linux without any issue.
The Build log looks like this:
Code: Select all
C:\Windows\system32\cmd.exe /C D:/bin/TDM-GCC-64/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ ttrack - Release ]----------"
'--wxcfg' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make.exe[1]: Entering directory 'D:/Projects/ttrack'
D:/bin/TDM-GCC-64/bin/windres.exe -i "D:/Projects/ttrack/win_resources.rc" --use-temp-file --define __WXMSW__ --define _UNICODE --include-dir D:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu --include-dir D:\Projects\wxWidgets-3.1.0/include --define WXUSINGDLL -o ./Release/win_resources.rc.o
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/main.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/main.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/MainFrame.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/MainFrame.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/wxcrafter.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/wxcrafter.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/wxcrafter_bitmaps.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/wxcrafter_bitmaps.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/plot.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/plot.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/spectrum-plot.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/spectrum-plot.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/waterfall-plot.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/waterfall-plot.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/windres.exe: warning: 24: 1: 1033: duplicate value
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/geoCtrlBase.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/geoCtrlBase.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/sats_in_view.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/sats_in_view.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/jsonreader.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/jsonreader.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/jsonval.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/jsonval.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/jsonwriter.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/jsonwriter.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/libawx-0.9/src/led.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/libawx-0.9_src_led.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/wxHexCtrl/Tag.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/wxHexCtrl_Tag.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/wxHexCtrl/TagDialogGui.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/wxHexCtrl_TagDialogGui.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -c "D:/Projects/ttrack/wxHexCtrl/wxHexCtrl.cpp" -w -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -ID:\Projects\wxWidgets-3.1.0/lib/gcc_dll/mswu -ID:\Projects\wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DSVN_REVISION=\"\" -DNDEBUG -o ./Release/wxHexCtrl_wxHexCtrl.cpp.o -I. -I.. -ID:\Projects\wxWidgets-3.1.0\lib\gcc_dll/mswu
D:/bin/TDM-GCC-64/bin/g++.exe -o ./Release/ttrack @"ttrack.txt" -L. -L. -L.. -LD:\Projects\wxWidgets-3.1.0/lib/gcc_dll -lwxexpat -lwxjpeg -lwxmsw31u -lwxmsw31u_gl -lwxpng -lwxregexu -lwxscintilla -lwxtiff -lwxzlib -lwxmsw310u_gcc_cl -lwxmsw310u_gl_gcc_cl -lsndfile-1
mingw32-make.exe[1]: Leaving directory 'D:/Projects/ttrack'
====0 errors, 0 warnings, total time: 00:00:11 seconds====