wxSharedPtr warnings..... what should i do? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
Experienced Solver
Experienced Solver
Posts: 79
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

wxSharedPtr warnings..... what should i do?

Post by Parduz » Mon Oct 22, 2018 1:08 pm

Using Code::blocks on a Windows PC

I want to compile the wxCharts libraries.

I get 144 warnings, all saying the same:

Code: Select all

||=== Build: Debug Win32 in wxcharts (compiler: GNU GCC 6.3.0 Compiler) ===|

C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h||In instantiation of 'void wxSharedPtr<T>::reftype::delete_ptr() [with T = wxChartTooltipProvider]':|
C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h|149|required from 'void wxSharedPtr<T>::Release() [with T = wxChartTooltipProvider]'|
C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h|41|required from 'wxSharedPtr<T>::~wxSharedPtr() [with T = wxChartTooltipProvider]'|
C:\SVILUPPO\Toolchains\wxCharts-master\src\wxareachart.cpp|95|required from here|
C:\SVILUPPO\Toolchains\wxWidgets-3.0.3\include\wx\sharedptr.h|119|warning: deleting object of abstract class type 'wxChartTooltipProvider' which has non-virtual destructor will cause undefined behavior [-Wdelete-non-virtual-dtor]|
I know wxCharts is not a wxWidgets library, but i think i should ask here (if not, sorry).

What should i do to avoid all these warnings?

Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 245
Joined: Tue Jun 07, 2016 1:07 pm

Re: wxSharedPtr warnings..... what should i do?

Post by Kvaz1r » Wed Oct 24, 2018 11:30 am

First of all warnings it's not errors, so you should be able to compile the source.
But since usually warnings are helpful you could open new issue or try to fix it and open PR.
As far I understand for this case enough to add virtual destructor for class .

Post Reply