What is the right way to install wxWidgets with codeblocks Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

I have downloaded the wxmsw setup and installed it.

I have downloaded the wxwidgets zip file along with headers and development zip files.

I compiled the wxwidgets with makefile command given on the page https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide

mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=0

It compiled properly. The dll is generated fine.

I have created a wxwidgets application by wxwidgets project template and specified the wxwidgets folder path in the wizard and the sample app builds fine and runs well.


When I create my own application then a simple command like close ends up calling recursively.

What is the problem with the wxwidgets compilation?
The same application works fine with Visual studio community edition

What is the right way to setup wxwidgets with codeblocks.

Please don't give me the PB user's steps because it is not explanatory.
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

I followed the setup steps posted on the forum

viewtopic.php?f=19&t=47233

But my app still goes in an infinite recursion.
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Code: Select all

mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=0
The UNICODE=0 is definitely suspicious. It's uncommon and usually not tested. Try with UNICODE=1. And the USE_XRC=1 is unnecessary.
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

Please give me a proper compilation command.

The one with without xrc
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Code: Select all

mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=debug
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

It still doesnt work.

I have tried the following commands:
mingw32-make.exe -j8 -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1
mingw32-make.exe -j8 -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1

Now instead of the recursion I am getting the following error in debugger:

Code: Select all

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\
Adding source dir: D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\
Adding file: D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\bin\Debug\ShellFromFB.exe
Changing directory to: D:/Programming/MySalesAppWxWidgets/NewAppsToWorkOn/ShellFromFB/.
Set variable: PATH=.;D:\wxWidgets-3.1.4\lib\gcc_dll;F:\TDM-GCC-64\bin;F:\TDM-GCC-64;C:\Program Files\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Microsoft DirectX SDK (February 2006)\Utilities\Bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Calibre2;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\11\bin;C:\Python;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Common Files\Autodesk Shared;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\Hostx86\x86;D:\Softwares\mingw-w64-v7.0.0\mingw-w64-v7.0.0;C:\Program Files\Microsoft Windows Performance Toolkit;D:\Softwares\mingw-w64-v7.0.0;C:\Program Files (x86)\dotnet;C:\Program Files\nodejs;C:\Program Files\Java\jdk-15.0.2\bin;C:\Program Files\CMake\bin;C:\Users\CHANDAN\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\CHANDAN\AppData\Local\Programs\Python\Python39;C:\Users\CHANDAN\AppData\Roaming\npm;C:\Users\CHANDAN\AppData\Roaming\npm\node_modules\@angular\cli\bin;C:\Users\CHANDAN\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Java\jdk-9.0.4\bin;C:\Program Files\CodeBlocks\MinGW\bin;D:\wxWidgets-3.1.4\lib\gcc_dll
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args D:/Programming/MySalesAppWxWidgets/NewAppsToWorkOn/ShellFromFB/bin/Debug/ShellFromFB.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Child process PID: 17612
At D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\CreateContactFrame.cpp:878
At D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\CreateContactFrame.cpp:875
In ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () (C:\WINDOWS\SYSTEM32\ntdll.dll)
#9  0x000000006bf9b3bf in wxTextCtrlBase::~wxTextCtrlBase (this=0x2e413c0, __in_chrg=<optimized out>) at ../../include/wx/textctrl.h:693
D:\wxWidgets-3.1.4\include\wx\textctrl.h:693:30184:beg:0x6bf9b3bf
At D:\wxWidgets-3.1.4\include\wx\textctrl.h:693
The Line at 878 is this->Destroy();
Last edited by DavidHart on Sat Feb 27, 2021 6:12 pm, edited 1 time in total.
Reason: Added code-tags
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Code: Select all

CreateContactFrame::~CreateContactFrame()
{
    //dtor
    //this->Destroy();
  wxLogDebug("~CreateContactFrame");
}
If it's still the same code as this, there must not be a Destroy() call in the dtor.
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

I have removed the destroy from the destructor

I am now getting the following error:

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\
Adding source dir: D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\
Adding file: D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\bin\Debug\ShellFromFB.exe
Changing directory to: D:/Programming/MySalesAppWxWidgets/NewAppsToWorkOn/ShellFromFB/.
Set variable: PATH=.;D:\wxWidgets-3.1.4\lib\gcc_dll;F:\TDM-GCC-64\bin;F:\TDM-GCC-64;C:\Program Files\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Microsoft DirectX SDK (February 2006)\Utilities\Bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Calibre2;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\11\bin;C:\Python;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Common Files\Autodesk Shared;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\Hostx86\x86;D:\Softwares\mingw-w64-v7.0.0\mingw-w64-v7.0.0;C:\Program Files\Microsoft Windows Performance Toolkit;D:\Softwares\mingw-w64-v7.0.0;C:\Program Files (x86)\dotnet;C:\Program Files\nodejs;C:\Program Files\Java\jdk-15.0.2\bin;C:\Program Files\CMake\bin;C:\Users\CHANDAN\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\CHANDAN\AppData\Local\Programs\Python\Python39;C:\Users\CHANDAN\AppData\Roaming\npm;C:\Users\CHANDAN\AppData\Roaming\npm\node_modules\@angular\cli\bin;C:\Users\CHANDAN\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Java\jdk-9.0.4\bin;C:\Program Files\CodeBlocks\MinGW\bin;D:\wxWidgets-3.1.4\lib\gcc_dll
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args D:/Programming/MySalesAppWxWidgets/NewAppsToWorkOn/ShellFromFB/bin/Debug/ShellFromFB.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Child process PID: 12752
At D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\CreateContactFrame.cpp:880
In ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () (C:\WINDOWS\SYSTEM32\ntdll.dll)
#9 0x000000006bf9b3bf in wxTextCtrlBase::~wxTextCtrlBase (this=0x2c7ab50, __in_chrg=<optimized out>) at ../../include/wx/textctrl.h:693
D:\wxWidgets-3.1.4\include\wx\textctrl.h:693:30184:beg:0x6bf9b3bf
At D:\wxWidgets-3.1.4\include\wx\textctrl.h:693
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Can you post/upload your current code again?

BTW: You have at least 3 different MinGW installations in your PATH, this can lead to all kind of problems.
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

It is just like the previous question I had asked a few days ago.

The question of form not closing.

Earlier it was destructor being called recursively.

Now it is the textctrlbase error.
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Check the compiler settings in Codeblock. If it uses absolute paths for the compiler. it's possible that a different compiler is used to build your project than the one that was used to build the wx libs.
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

Yes I am using absolute paths.

What are the settings path like?

Could you please mention the paths of compiler settings!
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Code: Select all

Set variable: PATH=.;D:\wxWidgets-3.1.4\lib\gcc_dll;F:\TDM-GCC-64\bin;F:\TDM-GCC-64;C:\Program Files\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Microsoft DirectX SDK (February
When you build wxWidgets from the command line, the first tool chain in PATH will be used, in this case the one in F:\TDM-GCC-64\bin

Make sure CodeBlocks uses the same.

Remove all unused tool chains from PATH and maybe even from your system.
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

Re: What is the right way to install wxWidgets with codeblocks

Post by sly_chandan »

I am still getting the same error while debugger runs at destructor


Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: d:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\
Adding source dir: d:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\
Adding file: d:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\bin\Debug\ShellFromFB.exe
Changing directory to: d:/Programming/MySalesAppWxWidgets/NewAppsToWorkOn/ShellFromFB/.
Set variable: PATH=.;D:\wxWidgets-3.1.4\lib\gcc_dll;F:\TDM-GCC-64\bin;F:\TDM-GCC-64;C:\Program Files\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Microsoft DirectX SDK (February 2006)\Utilities\Bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Calibre2;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files\Git\cmd;C:\Program Files\PostgreSQL\11\bin;C:\Python;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Common Files\Autodesk Shared;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\Hostx86\x86;D:\Softwares\mingw-w64-v7.0.0\mingw-w64-v7.0.0;C:\Program Files\Microsoft Windows Performance Toolkit;D:\Softwares\mingw-w64-v7.0.0;C:\Program Files (x86)\dotnet;C:\Program Files\nodejs;C:\Program Files\Java\jdk-15.0.2\bin;C:\Program Files\CMake\bin;C:\Users\CHANDAN\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\CHANDAN\AppData\Local\Programs\Python\Python39;C:\Users\CHANDAN\AppData\Roaming\npm;C:\Users\CHANDAN\AppData\Roaming\npm\node_modules\@angular\cli\bin;C:\Users\CHANDAN\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Java\jdk-9.0.4\bin;C:\Program Files\CodeBlocks\MinGW\bin;D:\wxWidgets-3.1.4\lib\gcc_dll
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args d:/Programming/MySalesAppWxWidgets/NewAppsToWorkOn/ShellFromFB/bin/Debug/ShellFromFB.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Child process PID: 2884
At D:\Programming\MySalesAppWxWidgets\NewAppsToWorkOn\ShellFromFB\CreateContactFrame.cpp:880
In ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () (C:\WINDOWS\SYSTEM32\ntdll.dll)
#9 0x000000006bf9b3bf in wxTextCtrlBase::~wxTextCtrlBase (this=0x2dbaa70, __in_chrg=<optimized out>) at ../../include/wx/textctrl.h:693
D:\wxWidgets-3.1.4\include\wx\textctrl.h:693:30184:beg:0x6bf9b3bf
At D:\wxWidgets-3.1.4\include\wx\textctrl.h:693
In ntdll!RtlRaiseException () (C:\WINDOWS\SYSTEM32\ntdll.dll)
#11 0x000000006bf9b3bf in wxTextCtrlBase::~wxTextCtrlBase (this=0x2dbaa70, __in_chrg=<optimized out>) at ../../include/wx/textctrl.h:693
D:\wxWidgets-3.1.4\include\wx\textctrl.h:693:30184:beg:0x6bf9b3bf
At D:\wxWidgets-3.1.4\include\wx\textctrl.h:693
Continuing...
In ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () (C:\WINDOWS\SYSTEM32\ntdll.dll)
#10 0x000000006bf9b3bf in wxTextCtrlBase::~wxTextCtrlBase (this=0x2dbaa70, __in_chrg=<optimized out>) at ../../include/wx/textctrl.h:693
D:\wxWidgets-3.1.4\include\wx\textctrl.h:693:30184:beg:0x6bf9b3bf
At D:\wxWidgets-3.1.4\include\wx\textctrl.h:693
Continuing...
[Inferior 1 (process 2884) exited with code 030000001564]
Debugger finished with status 0
Attachments
Untitled.png
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the right way to install wxWidgets with codeblocks

Post by doublemax »

Try to copy and paste the code from the "minimal" sample into your project and check if it runs correctly.

If yes, please post your current code again.
Use the source, Luke!
Post Reply