Author Topic: SVN 12550 does not compile  (Read 10808 times)

Offline gd_on

  • Lives here!
  • ****
  • Posts: 700
SVN 12550 does not compile
« on: December 03, 2021, 03:06:59 pm »
Or may be 12549...
I obtain  errors as shown in attached txt file (sorry, problems to include this in quotes ...)

Something related to wxHAS_REGEX_ADVANCED. I tried with wxWidgets 3.1.5 and also wxmaster (future wxWidgets 3.1.6) with the same problems.
Does it needs a specific wxwidgets configuration ?
I use the last Msys2 compilers, 11.2 Mingw64 versions.

« Last Edit: December 03, 2021, 03:37:32 pm by gd_on »
Windows 10 64 bits (21H2), svn C::B (last version or almost!), wxWidgets 3.1.6, Msys2 Compilers 11.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #1 on: December 03, 2021, 03:52:33 pm »
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?

Code
    #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.
« Last Edit: December 03, 2021, 04:30:37 pm by Miguel Gimenez »

Offline gd_on

  • Lives here!
  • ****
  • Posts: 700
Re: SVN 12550 does not compile
« Reply #2 on: December 03, 2021, 07:10:28 pm »
With this micropatch, it compiles and works.
Two small things:
  • the text in the upper tabs are "Find" and "Find in files". They are not tranlated in my french version. May be a _T is used somewhere instead of a _.
  • in find_replace.cpp, line 278, _T is used. May be a _ should be used because those chains may be translated.
Anyway, thanks for your reactivity

Windows 10 64 bits (21H2), svn C::B (last version or almost!), wxWidgets 3.1.6, Msys2 Compilers 11.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #3 on: December 03, 2021, 07:37:16 pm »
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:

Code
<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.
« Last Edit: December 03, 2021, 07:43:49 pm by Miguel Gimenez »

Offline gd_on

  • Lives here!
  • ****
  • Posts: 700
Re: SVN 12550 does not compile
« Reply #4 on: December 03, 2021, 08:07:10 pm »
I know how to extract chains from xrc files. I do that with a cmd file. It's in https://forums.codeblocks.org/index.php/topic,1022.0.html. I published some time ago my batch tools.
So I use poedit, only for the translation.

Windows 10 64 bits (21H2), svn C::B (last version or almost!), wxWidgets 3.1.6, Msys2 Compilers 11.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline sodev

  • Regular
  • ***
  • Posts: 458
Re: SVN 12550 does not compile
« Reply #5 on: December 03, 2021, 08:38:38 pm »
Poedit does not process XRC files, for this you can use wxrc (that is part of wxWidgets). It reads XRC files and extracts translatable strings (there is some hardcoded logic in that tool to detect translatable strings and the two examples above are supported) into ordinary dummy C++ headers. These headers you can process as usual with Poedit or anything else that can read gettext format.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #6 on: December 03, 2021, 09:03:45 pm »
Fixed compilation on MSW-64 bits and some strings that were not translatable in r12551, thanks gd_on for reporting and testing.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 700
Re: SVN 12550 does not compile
« Reply #7 on: December 03, 2021, 09:11:39 pm »
Effectively, wxrc is the tool I use in my batch file. May be I could use it in a better way... that's possible  ???
Windows 10 64 bits (21H2), svn C::B (last version or almost!), wxWidgets 3.1.6, Msys2 Compilers 11.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #8 on: December 04, 2021, 12:35:41 am »
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?

Code
    #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.

For my opinion, I think the PCH should be enabled in the 64bit windows cbp file(CodeBlocks_wx31_64.cbp).
The main reason is that it reduce the build time 50%.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #9 on: December 04, 2021, 10:30:39 am »
Speed is important, but even more important is coherency. I also think CodeBlocks_wx31_64.cbp should get the same changes of r11401.

Can you do it?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #10 on: December 05, 2021, 08:16:20 am »
Speed is important, but even more important is coherency. I also think CodeBlocks_wx31_64.cbp should get the same changes of r11401.

Can you do it?

Yes, I can do it. I will do a build time test before the change.

For CodeBlocks_wx31_64.cbp, I can add the PCH feature.
But we will have to add the PCH feature to other plugins.

See Tim's reply here: Re: Enable the PCH when build C::B against wx3.x
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #11 on: December 05, 2021, 11:08:47 am »
If you add PCH to the first plugin I can do it to the others (I have never used precompiled headers)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #12 on: December 05, 2021, 05:03:55 pm »
Code
 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:

Code
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.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #13 on: December 05, 2021, 05:18:33 pm »
Maybe those links are related:

91440 Precompiled headers regression in 9.2

ASLR is now enabled for GCC binaries and it breaks PCH  Issue #5719 msys2/MINGW-packages

I'm currently using a special GCC (https://github.com/Guyutongxue/mingw-release)

Any one using the msys2's native mingw-w64 gcc could try my patch file of CodeBlocks_wx31_64.cbp and see whether they fix this isisue or not, thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #14 on: December 05, 2021, 11:54:36 pm »
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):

Code
-------------- 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.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #15 on: December 06, 2021, 12:27:14 am »
I just successfully did the following build:

Within C::B loaded the CodeBlocks_wx31_64.cbp and configured it for the following compiler:

    Compiler Downloaded:
         https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.1-snapshot20211106-9.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-11.2.1-snapshot20211106-mingw-w64-9.0.0-r1.7z
    Directory:
       C:\mingw64-winlib

Attaches is the build log.

NOTE: wxWidget was not rebuilt and I did not run or try to run any of the output files.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #16 on: December 06, 2021, 01:23:00 am »
Plot thickens as I just successfully compiled the C::B using the Guyutongxue compiler as follows....

Within C::B loaded the CodeBlocks_wx31_64.cbp and configured it for the following compiler:

    Compiler Downloaded:
        https://github.com/Guyutongxue/mingw-release/releases/download/v11.2.0-r1/gytx_x86_64-11.2.0-posix-seh_r1.7z
    Directory:
       C:\mingw64_gtx

My source code I use is in the following github branch:
    https://github.com/acotty/codeblocks_sf/tree/AC-WindowsInstaller

Some notes on the branch:
1. It already includes the PCH changes I did a few days ago. 
2. There are a number of changes in the source tree that are still PR's against obfuscated's github repo, but I do not expect anything to progress with any of these as most of them are to do with Windows and not Linux.
3. There are also changes to the project file environment variables to make them more consistent and easy for me to use, but I have not  reviewed these to ensure they are good enough for eventual incorporation into the trunk.
4. You may find extra debugging that I have check in by accident.
5. The code includes a windows_installer directory that includes the files I use to build the installer. This is a separate SF SVN repo, but having it as a separate repo made building the installers  a PITA.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #17 on: December 06, 2021, 03:30:13 am »
Hi, AndrewCot, thanks for your detailed test and report.

I just switch my compiler to Msys2's native gcc compiler which is gcc 11.2.0 to build CodeBlocks_wx31_64.cbp, and I don't see the PCH issue now. (though I still use the wx 3.1.5 library built by guyu's compiler, I will later to rebuild wx 3.1.5 by Msys2's native gcc).

So, it looks like this issue is related to guyu's gcc. I will report bugs in his site.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #18 on: December 06, 2021, 07:07:17 am »
I did a build time test using msys2's 64bit gcc 11.2.0 on a win7 system.

When PCH is enabled, the CodeBlocks_wx31_64.cbp rebuild time is about: 273 seconds
When PCH is not enabled, the CodeBlocks_wx31_64.cbp rebuild time is about: 440 seconds

So, it is about 38% time reduce if I enable the PCH for CodeBlocks_wx31_64.cbp.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #19 on: December 06, 2021, 07:26:58 am »
What version of  guyu's compiler were you using? 11.2.0 release 0 or release 1 or some other version?

Good to see that your MSYS2 GCC 11.2.0 works.

I did not get as good a drop on my setup, I got a drop of about 35 seconds when building everything. I should do some more tests tomorrow when compiling just the CodeBlocks_wx31_64.cbp and see how I go and report my findings.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #20 on: December 06, 2021, 08:25:37 am »
What version of  guyu's compiler were you using? 11.2.0 release 0 or release 1 or some other version?
gytx_x86_64-11.2.0-posix-seh_r1, which is released Aug 01, 2021.
I have this compiler in two PCs, and both got the same PCH warning message: "sdk_precomp.h.gch: had text segment at different address".
So, I switch to using Msys2's gcc now.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #21 on: December 06, 2021, 09:57:58 am »
If you add PCH to the first plugin I can do it to the others (I have never used precompiled headers)


I see AndrewCot already did that, see here: https://github.com/acotty/codeblocks_sf/commit/9fc1965e72e1c4ef96227f8a84f2423563f25f4b

I can download his change/patch from:
https://github.com/acotty/codeblocks_sf/commit/9fc1965e72e1c4ef96227f8a84f2423563f25f4b.patch

Then use the command line "patch -p1 < 9fc1965e72e1c4ef96227f8a84f2423563f25f4b.patch" to apply to my local git repo. (git am does not work, I'm not sure why)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #22 on: December 11, 2021, 04:19:21 pm »
I have commit the PCH patches in r12572 and r12573.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #23 on: December 11, 2021, 09:23:00 pm »
Thank you for the changes, they work OK here although I have not tested the compilation times.

I know nothing about precompiled headers, but noted this comment from stahta01:

Quote
FYI: Code::Blocks has in the past 3 years not used the PCH correctly in the contrib projects.

Turning off "-DNOPCH" is a waste of time if the devs refuse to add the location of the PCH to the project search path.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3168
Re: SVN 12550 does not compile
« Reply #24 on: December 12, 2021, 12:58:48 am »
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:
Code
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


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #25 on: December 12, 2021, 02:22:55 am »
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:
Code
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


I'm using msys2's gcc compiler(gcc11). It works OK here. Maybe, the winlibs compiler does not support large pch files very well?
Or, we can ask winlibs author to check this issue?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #26 on: December 12, 2021, 02:25:16 am »
Thank you for the changes, they work OK here although I have not tested the compilation times.

I know nothing about precompiled headers, but noted this comment from stahta01:

Quote
FYI: Code::Blocks has in the past 3 years not used the PCH correctly in the contrib projects.

Turning off "-DNOPCH" is a waste of time if the devs refuse to add the location of the PCH to the project search path.

Yes, I agree with Tim's option. We can fix those issues in our repo.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3168
Re: SVN 12550 does not compile
« Reply #27 on: December 12, 2021, 05:54:49 pm »
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...

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #28 on: December 13, 2021, 12:54:55 am »
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:

Code
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:

Code
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.
« Last Edit: December 13, 2021, 12:57:41 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #29 on: December 13, 2021, 04:07:56 am »
Ollybdg,

When I build WxWidget I do not specify the following parameters
    USE_XRC=1
    USE_OPENGL=1
    CXXFLAGS="-Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-keep-inline-dllexport"

The WIKI page ("https://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_(MSW)")  has the following options:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport" >log.txt 2>&1
The codeblocks manual appears to not be up to date as the command line options specified on pages 133 & top of 134 do not specif the VENDOR=cb option!!!
The  https://github.com/PBfordev/wxpbguide is different again...

So my question if you get this far is what should the wxWidget options be in order to build WxWidget with the same options as included in the official C::B releases?


BlueHazzard,
If you get stuck or want more info on the process I used the following guide to create the batch file that I use to build WxWidgets 3.1.5 or the github source:
    https://github.com/PBfordev/wxpbguide

Attached is the batch file I use to build WxWidgets, it has a bunch of options in the file that allow me to build the debug or release versions, specify the compiler path to use. It also has the option to do a make clean PLUS create/update the setup.h. The batch file also uses power shell to calculate how long the build took, sorry I am still an old school MS batch file user.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #30 on: December 13, 2021, 06:03:43 am »
Ollybdg,

When I build WxWidget I do not specify the following parameters
    USE_XRC=1
    USE_OPENGL=1
    CXXFLAGS="-Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-keep-inline-dllexport"

The WIKI page ("https://wiki.codeblocks.org/index.php/Compiling_wxWidgets_3.0.0_to_develop_Code::Blocks_(MSW)")  has the following options:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport" >log.txt 2>&1
The codeblocks manual appears to not be up to date as the command line options specified on pages 133 & top of 134 do not specif the VENDOR=cb option!!!
The  https://github.com/PBfordev/wxpbguide is different again...

So my question if you get this far is what should the wxWidget options be in order to build WxWidget with the same options as included in the official C::B releases?

If I remember correctly, those two options: "-Wno-unused-local-typedefs -Wno-deprecated-declarations" is used to suppress a lot of warning when building the wx library. I use those two options years ago.

"-fno-keep-inline-dllexport" option is to avoid a gcc bug that if this option is not added, the gcc may crash? (this option is added many years ago, I just can't remember).

"USE_OPENGL=1" this option is that I want the result wx library can have OpenGL support.

"USE_XRC=1" this option maybe not necessary, that maybe it is enabled by default.

I remembered that for building C::B against wx, the wx should have the Direct2D enabled, which I need to manually edit a file in the wx source.


Quote
So my question if you get this far is what should the wxWidget options be in order to build WxWidget with the same options as included in the official C::B releases?
No, those options are only used when building wx library. For building C::B, I just use the *.cbp or *.workspaces file supplied by C::B source.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #31 on: December 13, 2021, 08:49:29 am »
Sorry, the WxWidget question is what options are used to build the WxWidget's DLL's that are part of the official C::B release.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5505
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN 12550 does not compile
« Reply #32 on: December 13, 2021, 08:55:21 am »
Sorry, the WxWidget question is what options are used to build the WxWidget's DLL's that are part of the official C::B release.

You may ask killerbot to answer this question. Because he is the author of the nightly build of C::B and the official windows release of C::B.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1016
Re: SVN 12550 does not compile
« Reply #33 on: December 13, 2021, 09:51:46 am »
He told it in this post

Offline AndrewCot

  • Regular
  • ***
  • Posts: 474
Re: SVN 12550 does not compile
« Reply #34 on: December 13, 2021, 10:09:15 am »
@Miguel Thanks for the link. I will need to update my build script to add the CXXFLAGS+="-std=c++11" in order to be the same.