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.
for the float decimal point. Now I myself use wxLocale for the language of my program resulting in:
// As we get our decimal point separator from Win32 and not the
// CRT there is a possibility of mismatch between them and this
// can easily happen if the user code called setlocale()
// instead of using wxLocale to change the locale. And this can
// result in very strange bugs elsewhere in the code as the
// assumptions that formatted strings do use the decimal
// separator actually fail, so check for it here.
wxASSERT_MSG
(
wxString::Format("%.3f", 1.23).find(str) != wxString::npos,
"Decimal separator mismatch -- did you use setlocale()?"
"If so, use wxLocale to change the locale instead."
);
so what can I do? I can hardly make opencv use wxLocale, can I? Just remove setlocale and hope for the best?
When is this called and when do you get the assert? Can you make sure that wxLocale is only initialized after openCV?
I also found some posts that indicate openCV might change the locale inside any of its functions. That would be really annoying, then you'd have to wrap each openCV call and reset the locale afterwards.
Or, if you're on Windows only and use a relatively new version of VS, you could move all openCV stuff into a separate thread and use _configthreadlocale() to make locale settings not global but unique per thread.
When is this called and when do you get the assert? Can you make sure that wxLocale is only initialized after openCV?
It is called when I use https://docs.opencv.org/3.4/dd/d1a/grou ... db65a25d2d to detect circles in an image and the assert appears when I close the program later. I would not know how to make sure wxLocale is initialized after opencv.
doublemax wrote: ↑Fri Dec 06, 2019 4:59 pm
I also found some posts that indicate openCV might change the locale inside any of its functions. That would be really annoying, then you'd have to wrap each openCV call and reset the locale afterwards.
Or, if you're on Windows only and use a relatively new version of VS, you could move all openCV stuff into a separate thread and use _configthreadlocale() to make locale settings not global but unique per thread.