Here compiles OK (wx3.1.5 with MinGW-w64).
May be related to precompiled headers, they depend on CB_PRECOMP being defined in project options.
Can you try this micropatch in findreplacedlg.cpp:23?
#include <wx/radiobox.h>
+ #include <wx/regex.h>
#include <wx/sizer.h>
+ #include <wx/stattext.h>
#include <wx/textctrl.h>
EDIT: found the problem, CB_PRECOMP is defined in CodeBlocks_wx31.cbp but not in CodeBlocks_wx31_64.cbp.
EDIT2: in CodeBlocks_wx31_64.cbp CB_PRECOMP is not defined and NOPCH is defined, so precompilation is disabled.
To CB_PRECOMP or not to CB_PRECOMP?. That is the question. Meanwhile, I will apply the micropatch in trunk tonight.
The problem is not really the "Find", that can be easily modified, but the "Replace" and all other visible texts from the dialog. They are embedded in findreplacedlg.xrc with XML like this:
<title>Replace</title>
<label>Replace</label>
so POedit won't find them and they will never be replaced. Even if you instruct POedit to detect those strings, there is no call to _() for them so they won't be translated.
I really don't know how translation of an XRC can be done, apart from creating one version per language.
EDIT: looks like the XRC loader call wxGetTranslation(), will investigate... But the POedit problem is still there.
src/CodeBlocks_wx31_64.cbp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/CodeBlocks_wx31_64.cbp b/src/CodeBlocks_wx31_64.cbp
index 67329efc..3ef2b833 100644
--- a/src/CodeBlocks_wx31_64.cbp
+++ b/src/CodeBlocks_wx31_64.cbp
@@ -85,7 +85,6 @@
<Option output="devel31_64/codeblocks" prefix_auto="1" extension_auto="1" />
<Option working_dir="devel31_64" />
<Option object_output=".objs31_64" />
- <Option external_deps="" />
<Option type="3" />
<Option compiler="gcc" />
<Option parameters="--debug-log --no-dde --no-check-associations --multiple-instance --verbose -p debug" />
@@ -634,18 +633,19 @@
</VirtualTargets>
<Compiler>
<Add option="-Wall" />
+ <Add option="-std=gnu++11" />
+ <Add option="-m64" />
<Add option="$(#CB_RELEASE_TYPE)" />
<Add option="-pipe" />
<Add option="-mthreads" />
- <Add option="-m64" />
<Add option="-fmessage-length=0" />
<Add option="-fexceptions" />
- <Add option="-std=gnu++11" />
+ <Add option="-Winvalid-pch" />
<Add option="-DHAVE_W32API_H" />
<Add option="-D__WXMSW__" />
<Add option="-DWXUSINGDLL" />
<Add option="-DcbDEBUG" />
- <Add option="-DNOPCH" />
+ <Add option="-DCB_PRECOMP" />
<Add option="-DwxUSE_UNICODE" />
<Add option="-D_WIN64" />
<Add directory="$(#WX31_64.include)" />
@@ -658,6 +658,7 @@
<Add directory="$(#WX31_64)/lib/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
</ResourceCompiler>
<Linker>
+ <Add option="-m64" />
<Add library="wxmsw$(WX_VERSION)$(WX_SUFFIX)" />
<Add directory="$(#WX31_64.lib)/gcc_dll$(WX_CFG)" />
<Add directory="devel31_64" />
@@ -987,6 +988,7 @@
<Option target="sdk" />
</Unit>
<Unit filename="include/sdk.h">
+ <Option compile="1" />
<Option weight="1" />
<Option target="src" />
</Unit>
@@ -997,6 +999,7 @@
<Option target="sdk" />
</Unit>
<Unit filename="include/sdk_precomp.h">
+ <Option compile="1" />
<Option weight="0" />
<Option target="sdk" />
</Unit>
@@ -4262,8 +4265,6 @@
<Option target="src" />
</Unit>
<Extensions>
- <code_completion />
- <envvars />
<wxsmith version="1">
<gui name="wxWidgets" src="" main="" init_handlers="necessary" language="CPP" />
<resources>
@@ -4286,7 +4287,6 @@
<wxDialog wxs="plugins/codecompletion/wxsmith/goto_function.wxs" src="plugins/codecompletion/gotofunctiondlg.cpp" hdr="plugins/codecompletion/gotofunctiondlg.h" fwddecl="1" i18n="1" name="GotoFunctionDlg" language="CPP" />
</resources>
</wxsmith>
- <debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
This is the patch/diff file I use to enable the PCH for the CodeBlocks_wx31_64.cbp, but I see some build warnings:
Running target pre-build steps
.objs31_64\autorevision +wx +int +t .. include/autorevision.h
g++.exe -Wall -std=gnu++11 -m64 -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -IE:\code\wxWidgets-3.1.5\include -IE:\code\wxWidgets-3.1.5\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\code\cb\cb_sf_git\cccrash2019\src\include\sdk_precomp.h -o .objs31_64\include\sdk_precomp.h.gch
g++.exe -Wall -std=gnu++11 -m64 -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -IE:\code\wxWidgets-3.1.5\include -IE:\code\wxWidgets-3.1.5\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\code\cb\cb_sf_git\cccrash2019\src\sdk\configmanager-revision.cpp -o .objs31_64\sdk\configmanager-revision.o
g++.exe -Wall -std=gnu++11 -m64 -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -IE:\code\wxWidgets-3.1.5\include -IE:\code\wxWidgets-3.1.5\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\code\cb\cb_sf_git\cccrash2019\src\sdk\annoyingdialog.cpp -o .objs31_64\sdk\annoyingdialog.o
D:\code\cb\cb_sf_git\cccrash2019\src\sdk\configmanager-revision.cpp:15:25: warning: .objs31_64\include/sdk_precomp.h.gch: had text segment at different address [-Winvalid-pch]
15 | #include "sdk_precomp.h"
| ^
I'm not sure what does this error message come from. I still need some time to find a solution.
I am using Windows 10 (21H2 19044.1387 , latest and patched as of 3-Dec-2021) and MSYS2 x64 using the latest (GCC 11.2.0) and WxWidget 3.1.5 (built with same MSYS2 GCC 11.2.0). I do not get the error/warning.
The command I use to build C::B (via a batch file that configures the parameters) is:
RUNNING: ""C:\Program Files\CodeBlocks\codeblocks.exe" --no-dde --multiple-instance --verbose --log-to-file --no-batch-window-close --target=All --build "D:\Andrew_Development\WorkingOnThese\AC-WindowsInstaller\src\CodeBlocks_wx31_64 - no Fortran.workspace""
The workspace has the "plugins/contrib/FortranProject/FortranProject_cbsvn_wx31_64.cbp" project removed as I used to get the src from GIT and as such did not include the fortran src.
Attached is the full build log.
The relevant lines from the log are (I have added extra lines to make it easier to read):
-------------- Build: sdk in Code::Blocks wx3.1.x (64 bit) (compiler: GNU GCC Compiler)---------------
Running target pre-build steps
.objs31_64\autorevision +wx +int +t .. include/autorevision.h
g++.exe -Wall -std=gnu++11 -m64 -g -O0 -ggdb -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -Winvalid-pch -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -ID:\Andrew_Development\wxWidgets-3.1.5\include -ID:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll""\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\Andrew_Development\WorkingOnThese\AC-WindowsInstaller\src\include\sdk_precomp.h -o .objs31_64\include\sdk_precomp.h.gch
g++.exe -Wall -std=gnu++11 -m64 -g -O0 -ggdb -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -Winvalid-pch -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -ID:\Andrew_Development\wxWidgets-3.1.5\include -ID:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll""\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\Andrew_Development\WorkingOnThese\AC-WindowsInstaller\src\sdk\configmanager-revision.cpp -o .objs31_64\sdk\configmanager-revision.o
g++.exe -Wall -std=gnu++11 -m64 -g -O0 -ggdb -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -Winvalid-pch -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -ID:\Andrew_Development\wxWidgets-3.1.5\include -ID:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll""\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\Andrew_Development\WorkingOnThese\AC-WindowsInstaller\src\sdk\annoyingdialog.cpp -o .objs31_64\sdk\annoyingdialog.o
g++.exe -Wall -std=gnu++11 -m64 -g -O0 -ggdb -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -Winvalid-pch -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -ID:\Andrew_Development\wxWidgets-3.1.5\include -ID:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll""\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\Andrew_Development\WorkingOnThese\AC-WindowsInstaller\src\sdk\autodetectcompilers.cpp -o .objs31_64\sdk\autodetectcompilers.o
g++.exe -Wall -std=gnu++11 -m64 -g -O0 -ggdb -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -Winvalid-pch -DCB_PRECOMP -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -ID:\Andrew_Development\wxWidgets-3.1.5\include -ID:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll""\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c D:\Andrew_Development\WorkingOnThese\AC-WindowsInstaller\src\sdk\base64.cpp -o .objs31_64\sdk\base64.o
GCC version info:
C:\msys64\mingw64\bin\gcc.exe --version
gcc (Rev2, Built by MSYS2 project) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I can not build codeblocks with pch enabled....
I use the latest winlibs compiler (gcc11) and cc1plus.exe crashes every time i try to build codeblocks with pch enabled:
cc1plus.exe caused an Access Violation at location 00007FF6BF009080 in module cc1plus.exe Reading from location 0000000011800F14.
AddrPC Params
00007FF6BF009080 000002A924CBA480 0000000000000000 0000000000000001 cc1plus.exe!0x7ff601119080
00007FF6BF0098F4 00000000000000D0 00007FF6BEFE7096 000002A926640000 cc1plus.exe!0x7ff6011198f4
00007FF6BEFDF0D6 0000000000000000 0000000000000000 0000000000000000 cc1plus.exe!0x7ff6010ef0d6
00007FF6BDF89F5D 000002A926642680 000000B0829FDE50 000002A924E102D0 cc1plus.exe!0x7ff600099f5d
00007FF6BEFDE1FC 000000B0829FDF10 00007FFC00000000 0000000000000000 cc1plus.exe!0x7ff6010ee1fc
00007FF6BEFDE7ED 000000B0829FE9B0 000000000000E000 0000000000AA000A cc1plus.exe!0x7ff6010ee7ed
00007FF6BEFDEE19 00007FF60000000B 00007FF6BF775240 0000000000000008 cc1plus.exe!0x7ff6010eee19
00007FF6BE581E8A 00007FF6BF812054 0000000000000000 0000000000000000 cc1plus.exe!0x7ff600691e8a
00007FF6BF068A23 000000B0829FE080 00007FF6BDEF0000 000000B0829FE130 cc1plus.exe!0x7ff601178a23
00007FFC19560E10 0000000000000000 000000B0829FE630 000000B0829FECF0 ucrtbase.dll!__C_specific_handler
00007FFC1B9920CF 0000000000000000 000000B0829FE630 000000B0829FECF0 ntdll.dll!RtlpExecuteHandlerForException
00007FFC1B941454 0000000000000000 0000000000000000 00000000000002A0 ntdll.dll!RtlDispatchException
00007FFC1B990BFE 0000000000000000 0000000000000000 000002A924C20150 ntdll.dll!KiUserExceptionDispatch
00007FF6BF009080 000002A924CBA480 0000000000000000 0000000000000000 cc1plus.exe!0x7ff601119080
00007FF6BF0098F4 000002A924C28D24 000002A924C20150 000000000000000A cc1plus.exe!0x7ff6011198f4
00007FF6BEFDF0D6 0000000000000000 0000000000000000 0000000000000000 cc1plus.exe!0x7ff6010ef0d6
00007FF6BDF89F5D 0000000000000000 000000B0829FF1F0 0000000000000003 cc1plus.exe!0x7ff600099f5d
00007FF6BEFDE1FC 000000B0829FF2B0 0000000000000000 000002A9267D3D70 cc1plus.exe!0x7ff6010ee1fc
00007FF6BEFDE7ED 0000000000000008 00007FFC19538091 000002A924CB1B80 cc1plus.exe!0x7ff6010ee7ed
00007FF6BEFDFD4A 000002A924CBE5E0 000002A924CBE5E0 0000000000000003 cc1plus.exe!0x7ff6010efd4a
00007FF6BE2EA33F 0000000000000003 00007FF6BF1D96D5 000002A924CBCB50 cc1plus.exe!0x7ff6003fa33f
00007FF6BE11A3EA 0000000000000001 0000000000000000 0000000000000000 cc1plus.exe!0x7ff60022a3ea
00007FF6BEFFF5E1 0000000000000000 0000000500000C80 0000000000000001 cc1plus.exe!0x7ff60110f5e1
00007FF6BEFF76C9 0000000000000001 FFFFDFFEFFFFFDFF 0000000100001A01 cc1plus.exe!0x7ff6011076c9
00007FF6BEFF7C48 0000000000000057 000002A926726680 0000000000000045 cc1plus.exe!0x7ff601107c48
00007FF6BF006969 0000000000000000 000002A9CA0000CA 0000000000000000 cc1plus.exe!0x7ff601116969
00007FF6BF00DE50 000000B0829FF980 000002A924CBCB50 000002A924CBCD18 cc1plus.exe!0x7ff60111de50
00007FF6BE110C8B 000000B0829FF980 000002A924CE5060 00007FF6BF8B98E8 cc1plus.exe!0x7ff600220c8b
00007FF6BDFF167C FFFFFD56DB3C6F20 00007FF6BEFF8E12 00007FF6BFA17258 cc1plus.exe!0x7ff60010167c
00007FF6BE03BEC3 000002A924CAE360 0000000000000025 0000000000000000 cc1plus.exe!0x7ff60014bec3
00007FF6BE119A4F 00007FF6BF162020 00007FF6BFA159A0 000002A924C4D960 cc1plus.exe!0x7ff600229a4f
00007FF6BE582081 000002A924CC5F90 0000000000000025 0000000000000000 cc1plus.exe!0x7ff600692081
00007FF6BF13227A 00007FF6BDEF0000 0000002E00000051 000002A924C3A000 cc1plus.exe!0x7ff60124227a
00007FF6BF15F227 0000000000000051 00007FF6BF8B8008 0000000000000000 cc1plus.exe!0x7ff60126f227
00007FF6BDEF1445 0000000000000000 0000000000000000 0000000000000000 cc1plus.exe!0x7ff600001445
00007FF6BDEF1146 0000000000000000 0000000000000000 0000000000000000 cc1plus.exe!0x7ff600001146
00007FFC1B7A7034 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk
00007FFC1B942651 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart
Can you give me a direction how you compile codeblocks with msys2?
If i use the package for wxWidgets all paths in codeblocks are wrong,
If i compile wxWidgets my self also all paths are wrong.
If i try to compile wxWidgets with mingw32 makefile and msys2 then i am not able to compile it...
1, you have to install msys2
2, you need to use the pacman command to install the gcc compiler for mingw64 subsystem. for example:
pacman -S mingw-w64-x86_64-toolchain
3, set the gcc's binary folder(in my system, it looks like: "F:\msys2\mingw64\bin" ) to your system's PATH environment
4, download a wx 3.1.5 source, and swith to the build/msw sub folder, (maybe some config file need to be modified to enable the opengl?, I can't remember correctly right now)
5, run the command line:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-keep-inline-dllexport" > log-release.txt 2>&1
6, go the the Code::Blocks and open the global variables settings, set the "cb_release_type" and "wx31_64".
7, open the "CodeBlocks_wx31_64.cbp" or "CodeBlocks_wx31_64.workspace" to build.
That's all.