I am testing a fully automatic C++ build system generator and the platform produces the necessary "CMakeLists.txt" and the other configuration files automatically for both kernel and GUI. Previously, I could not produce an executable for GUI and there was a linking problem. Now, I can overcome the linking problem that I have mentioned previously and the app can successfully generate its own configuration files automatically. On the current version of the GUI, I have used the wxWidgets version 3.3.1 and MinGW-w64 13.0.0 as compiler and the GUI is closing without any crash.
Every wxWidgets configuration is performed automatically by the CMAKE with the following CMAKE command.
include(FetchContent)
FetchContent_Declare(
wxWidgets
GIT_TAG v3.3.1
GIT_PROGRESS TRUE
)
FetchContent_GetProperties(wxwidgets)
FetchContent_MakeAvailable(wxwidgets)
However, when I try to check whether the app can produce the configuration files without human intervention, the
platform produces "CMakeLists.txt" files for direct linking without using FetchContent property. Off course, it is possible to make
availably of wxWidgets library by default and in the future, I will add this property. But, I am trying to check direct linking
with automatically produced CMakeLists.txt files and therefore, I compile the app using the same compiler "MinGW-w64 13.0.0"
for wxWidgets version 3.3.3 with direct linking. Unfortunately, the app crashes on close when I use wxWidgets version 3.3.3 with direct linking .
I have written the configuration codes which are produced automatically by the platform.
The GUI of the app works successfully and it crashy solely on close.
target_link_libraries(Pcynlitx PUBLIC
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_adv.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_xrc.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_stc.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_aui.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_core.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxpngd.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxlexillad.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_gl.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_richtext.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxscintillad.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud_net.a
C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_webview.a
imm32
gcc
stdc++
wxtiffd
wxjpegd
wxpngd
wxwebpd
wxzlibd
wxregexud
wxexpatd
kernel32
user32
gdi32
gdiplus
msimg32
comdlg32
winspool
winmm
shell32
shlwapi
comctl32
ole32
oleaut32
uuid
rpcrt4
advapi32
version
ws2_32
wininet
oleacc
uxtheme
)
I can not determine the reason why the app crashes. The gdb debugger gives the following back trace
Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffae64af6a3 in ntdll!RtlInitializeResource () from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0 0x00007ffae64af6a3 in ntdll!RtlInitializeResource () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1 0x00007ffae64c016f in ntdll!RtlSleepConditionVariableCS () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2 0x00007ffae64c13e2 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3 0x00007ff70105b986 in wxCriticalSection::Enter (
this=0x7ff701bc7e00 <(anonymous namespace)::UntranslatedStringHolder::ms_criticalSection>)
at ../../src/msw/thread.cpp:143
#4 0x00007ff7014711ca in wxCriticalSectionLocker::wxCriticalSectionLocker (this=0x5ffd40, cs=...)
at C:/wxWidgets-3.3.3/include/wx/thread.h:299
#5 0x00007ff70102f251 in (anonymous namespace)::UntranslatedStringHolder::~UntranslatedStringHolder (
this=0x29ed8f8) at ../../src/common/translation.cpp:1511
#6 0x00007ff70139b6ee in run_dtor_list ()
#7 0x00007ff70139b850 in tls_atexit_callback ()
#8 0x00007ff7013b6e3d in run_callback ()
#9 0x00007ffae585e88a in msvcrt!_initterm_e () from C:\WINDOWS\System32\msvcrt.dll
#10 0x00007ff700cd137d in __tmainCRTStartup ()
#11 0x00007ff700cd1038 in WinMainCRTStartup ()
I did not use wxThread anywhere and it still points to wxThread. Most probably, you don't have the time to check the code but I have
added the related link for the codebase
Even Though I have written a class in order to use wxThread, I used std::thread on the threading for GUI.
Erkam Murat Bozkurt